Hi Charlie,

On Mar 22, 2010, at 2:19 PM, Charles Oliver Nutter wrote:

On Sun, Mar 21, 2010 at 2:24 PM, Antoine Toulme <[email protected]> wrote:
This compiler helps me as I need to use a different JDK for part of the
projects I have to compile.

Why do you need to do that? All current Java releases support
compiling code for older JVMs...

~/projects/jruby ➔ javac 2>&1 | grep release
-source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version

~/projects/jruby ➔ javac -version
javac 1.6.0_17

I can't speak for Antoine, but I know I've run into problems where code compiled on a 1.5 JDK won't run on a 1.4 JRE, even though the source/target options are provided. In the specific case I recall, there was change in BigDecimal such that if you compiled this code:

new BigDecimal(4)

against 1.5, it would throw a NoSuchMethodError when run on 1.4. The problem was that 1.4 only had BigDecimal(double) while 1.5 has BigDecimal(int).

Given the backwards-incompatible changes from 1.5 to 1.6 (e.g., in JDBC), I wouldn't be surprised if there are similar gotchas in that transition.

Rhett

Reply via email to