I realized that in Netbeans the default Java platform for the projects was not the Sun’s and it was not possible to change this setting by using some features of NetBeans, but I had to manually edit a configuration file.
- Ubuntu 11.04
- Netbeans 6.9
- Sun Java 1.6
- Open Netbeans, and go to Tools-> Java Platforms and add Sun Java 1.6 selecting the folder /usr/lib/jvm/java-6-sun, but you can ‘t select the default platform
- Edit the file /etc/netbeans.conf with root privileges, for example with the console command sudo gedit /etc/netbeans.conf and enter the following line: netbeans_jdkhome = “/usr/lib/jvm/java-6-sun”