Bear Bibeault wrote:That's just a symbolic link pointing to the most recent version.
Andrew Monkhouse wrote:Mike - what is you are trying to do?
If you are just developing and using code on your own machine then it shouldn't really matter: the code you compiled when JDK 5 was the default should run without needing to be recompiled.
If you are developing with the intent to deliver to a machine that is running an older JVM, then you could use the "-target <release>" option within javac to specify what JVM you need to support. This can also be specified in your ant build files and/or your maven pom files if needed.
Ulf Dittmer wrote:"class file compatibility" sounds about right. From the command line (or using Ant) one would need to set both "-source" and "-target".
Of course, the code will fail on Java 5 JREs if it actually uses Java 6 methods or classes. This setting merely produces a class file that works with earlier JREs, it does not ensure that the code will actually run. So any Java 6-specific stuff needs to be wrapped in checks that ensure it's not executed on a Java 5 JRE.
That's the advantage of using an actual Java 5 JDK for compilation - it would produce errors for anything it doesn't recognize.