15Apr/090
Java 1.6 + NetBeans 6.5 + OSX
I hadn't actually had a real need to force use of Java 1.6 yet. I did have a Java platform definition in NetBeans for 1.6 and would use that. But recently, my project has become more 1.6 heavy and I've had to switch to a JDK 1.6 source and binary format.
I found a very useful blog post that explained the upgrade here: http://point2blog.wordpress.com/2009/02/17/defaulting-to-jdk-16-in-netbeans-65-on-osx/
This is the relevant excerpt from the blog post by Damien Gabrielson:
Locate the NetBeans config file, typically located at “/Applications/NetBeans/NetBeans 6.5.app/Contents/Resources/NetBeans/etc/netbeans.conf” and open the file in your favourite editor Set the “netbeans_jdkhome” parameter to the JDK 1.6 home directory (ie. netbeans_jdkhome=
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home)
But that wasn't good enough for my use. I am developing a web application that runs on the Glassfish application server. That too needs to be running Java 1.6. The fix is easy:
- Open the "asenv.conf" file. In my case, it can be found at: /Applications/NetBeans/glassfish-v2ur2/config/asenv.conf
- Set the "AS_JAVA" parameter to the Java 1.6 directory. My entry reads:
- AS_JAVA="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home"