Basically this is caused when any project dependency is missing. Suppose you have a java
project setup in Netbeans, but Netbeans couldn't find jdk
package. So it fails to load.
But when you use console to load the application, you pass the jdk
location to application to load its dependency, so it worked perfectly.
The problem can be solved by modifying Netbeans configuration file. Go to installation location of Netbeans (in my case - usr/local/netbeans-8.1
), then inside /etc
folder edit netbeans.conf
file and set the location of your jdk installation in netbeans_jdkhome
variable
netbeans_jdkhome="/usr/lib/jvm/java-8-oracle"
That's it. Start your Netebeans application by clicking on your application icon.
You can get list of locations for java installation using following command -
update-alternatives --config java