I have been usigng NetBeans 2 years now and have encountered an issue. After a normal apt-get upgrade NetBeans stopped working altogether. After this I reinstall the JRE and JDK to no avail. However, after reinstalling NetBeans it would open but with the following error:

The JDK is missing and is required to run some NetBeans modules Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.

After reading though the post I discover/usr/local/share/java/ does not exist. Is there any way to restore the files and if not how may I resolve the issue?

I have tried the solution suggested in this post, it has no effect other than a different error message for one project.

Not all requested modules can be enabled: [StandardModule:org.netbeans.modules.j2ee.persistence.kit jarFile: /home/MY_HOME/netbeans-8.1/java/modules/org-netbeans-modules-j2ee-persistence-kit.jar, StandardModule:org.netbeans.modules.maven.kit jarFile: /home/MY_HOME/netbeans-8.1/java/modules/org-netbeans-modules-maven-kit.jar, StandardModule:org.netbeans.modules.debugger.jpda.kit jarFile: /home/MY_HOME/netbeans-8.1/java/modules/org-netbeans-modules-debugger-jpda-kit.jar, StandardModule:org.netbeans.modules.hibernate jarFile: /home/MY_HOME/netbeans-8.1/java/modules/org-netbeans-modules-hibernate.jar, StandardModule:org.netbeans.modules.java.kit jarFile: /home/MY_HOME/netbeans-8.1/java/modules/org-netbeans-modules-java-kit.jar, StandardModule:org.netbeans.modules.form.kit jarFile: /home/MY_HOME/netbeans-8.1/java/modules/org-netbeans-modules-form-kit.jar, StandardModule:org.netbeans.modules.spring.beans jarFile: /home/MY_HOME/netbeans-8.1/java/modules/org-netbeans-modules-spring-beans.jar]

First, you have to install a JDK, because you said in your comments:

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-oracle/jre/bin/java Nothing to configure.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

Now you have to configure Netbeans to use this JDK or run Netbeans with

netbeans --jdkhome /usr/lib/jvm/java-8-oracle