netbeans not all requested modules can be enabled

I know this question has already been posted, but the solutions provided don't work for me. I added the webupd8team/java repository and installed oracle-java8-installer and oracle-java8-set-default. I downloaded netbeans 8.1 from netbeans.org (full version), installed it but when it comes to enabling the java modules it fails, showing me a list of all the modules netbeans can't enable.

I also ran sudo update-alternatives --config java, which outputs

  0            /usr/lib/jvm/java-8-oracle/jre/bin/java   1         auto mode
* 1            /usr/lib/jvm/java-8-oracle/jre/bin/java   1         manual mode

JDK seems to be missing.

I get the correct output when I run both java -version and javac -version

I also tried to run the command netbeans --jdkhome /usr/lib/jvm/java-8-oracle, unsuccessfully. I get an error message saying netbeans is not installed.

Now, all this only happens with the version I download from the website. When I install netbeans from the shell (sudo apt-get install netbeans) everything works just fine.

The thing is I need the full version from the website, because I'm working with HTML5, CSS, J2EE and GlassFish server support.

All help is appreciated.


Go to /etc and open netbeans.conf.

Note: you can find netbeans_root_folder with ls -l $(which netbeans)

Make sure the variable netbeans_jdkhome has the correct value, something like:

netbeans_jdkhome="/usr/lib/jvm/java-8-oracle"

Either edit /usr/local/netbeans-X.Y/etc/netbeans.conf to contain

netbeans_jdkhome="/usr/lib/jvm/java"

Or use the command:

/usr/local/netbeans-X.Y/bin/netbeans --jdkhome /usr/lib/jvm/java

edit /usr/local/netbeans-X.Y/etc/netbeans.conf file

netbeans_jdkhome="/usr/lib/jvm/java-8-openjdk-amd64"

It means the netbeans.conf file (located in two places) was not set up correctly.To solve this you might do:

First: open TERMINAL go to /etc

cd /etc

Second: open netbeans.conf file as superuser (sudo):

sudo gedit netbeans.conf

Third: Edit the line wich corresponds to your JVM (Java Virtual Machine) folder. It looks like #netbeans_jdkhome="/usr/lib/jvm/java-8-openjdk-amd64/".

Change the local according to your JVM version.

To find out what JVM version you use, go to the JVM folder by typing in terminal:

cd /usr/lib/jvm

and see what name is folder that contains JVM. For example, mine is named java-8-opendjdk-amd64

Fourth: let's edit the second netbeans.conf file located at your Netbeans installation folder. Open a TERMINAL and type (here I'll use Netbeans 8.2 version):

cd /netbeans-8.2/etc

And open netbeans.conf file in editor as a superuse (sudo):

sudo gedit netbeans.conf

Last step: Edit the line wich corresponds to your JVM (Java Virtual Machine) folder. It looks like #netbeans_jdkhome="/usr/lib/jvm/java-8-openjdk-amd64/".

Don't forget to uncomment the line by removing the # character.

Now save the file, close Netbeans and run it again! IT WORKS !