views:

22

answers:

0

My work project needs to be compiled and run under JDK1.5 and I'm on a Mac. I followed the instructions here to get 1.5 back on Snow Leopard, and it works fine when building from IntelliJ IDEA, or if I'm just in the same directory as the build.xml and try "ant CleanRebuild" When I "Run Target" in NetBeans they're all compiled with the wrong version resulting in

java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class...

when tomcat is trying to start up.

So things I've tried

  1. Set the "Java Platform" to 1.5 under the project properties/libraries.
  2. Set the Source/Binary Format to JDK 5 under project properties/sources.
  3. Pointed the ant home to the ant I'm using under preferences/ant
  4. Renaming every javac executable I could find in the hopes NetBeans would fail to compile and I could figure out which one it was using (no luck)
  5. Setting 1.5 as the default, resulting in the need to point $netbeans_jdkhome to the 1.6 jdk in order for NetBeans to even start.

All unsuccessful....

Again, if I cd into the directory of the netbeans project with the build.xml and run the command manually all is well....so NetBeans. What's the deal?