9

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]
Blunderchips
  • 314
  • 2
  • 4
  • 14
  • How did you install the JDK? – A.B. Nov 16 '15 at 07:09
  • I used [this](https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get) tutorial when I first started with Ubuntu. All has been working fine up until recently. – Blunderchips Nov 16 '15 at 07:17
  • What's the output of `sudo update-alternatives --config java` – A.B. Nov 16 '15 at 07:19
  • 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. – Blunderchips Nov 16 '15 at 07:21
  • You have only a JRE installed. Use this answer: http://askubuntu.com/a/640945/367165 to install the JDK – A.B. Nov 16 '15 at 07:25
  • The solution in the linked answer has the effect, that you have now a installed JDK. – A.B. Nov 16 '15 at 07:39
  • It did not work, I have edited the question with the new error message. Only one project gave me that error, the rest maintain message when i tried to open them. – Blunderchips Nov 16 '15 at 07:40
  • `sudo chown -r "$USER":"$USER" ~/netbeans-8.1` – A.B. Nov 16 '15 at 07:45
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/31635/discussion-between-matthew-sid-van-der-bijl-and-a-b). – Blunderchips Nov 16 '15 at 07:48

1 Answers1

8

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
A.B.
  • 89,123
  • 21
  • 245
  • 323