Configuring Netbeans 6.5 to use JDK 6 on Mac OS X
Normally I work with my favorite Java IDE Eclipse. However for this project they are using NetBeans so I had to switch over. I was having trouble checking out the project since they were building against Java 6 and even the latest version of NetBeans still defaults to Java 5 (1.5). So this how to fixed my problems.
- 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)
- In NetBeans, for each project, right click on the project in the projects window and select “Properties”
- Ensure the “Source/Binary Format” is set to “1.6″
- Click on “Tools” on the toolbar and select “Java Platforms”
- Under “J2SE” the default platform should now be “JDK 1.6″