The JDK is missing and is required to run some NetBeans modules

随声附和 提交于 2019-11-30 10:55:09

问题


Complete error message: 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.

Some details: I just installed Netbeans on Linux mint for the first time and when I start it when its turning on modules this error message appears. But I do have jdk installed.

$ java -version

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

$ javac -version

javac 1.8.0_66

回答1:


Find the file [netbeans installation directory]/etc/netbeans.conf

Luckily, Linux has a find helper like find /home/ -name "netbeans.conf, in which you can change the /home/ to a location where you want to search.

I found it at /usr/local/netbeans-8.1/etc/netbeans.conf

Once, you found the file, the following property needs to be set:

netbeans_jdkhome="[jdk_path]"

where you can find the jdk_path using:

update-alternatives --config java

In my case, I found it at /opt/java/jdk1.8.0_191




回答2:


  1. Open netbeans.conf

sudo nano "/usr/lib/jvm/java-8-oracle/netbeans.conf"

  1. Set proper sdk path:

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

  1. Exit Ctrl + X and to save changes Ctrl + T



回答3:


When netbeans has problems trying to find the path of the jdk, it's mainly because the version of the jdk does not match. Open the file C:\Program Files\NetBeans 8.2\etc\netbeans.conf, and verify that netbeans_jdkhome = "C:\Program Files\Java\jdk1.8.0_111".




回答4:


[Solved] For Mac OSX 10.11 (El Capitan). Solution may be similar for other Unix-based systems.

The problem may have occurred because I inadvertently installed the jre prior to installing the jdk. I uninstalled the jre, installed the jdk and reinstalled NetBeans but the problem (popup window) remained. However, the fix was fairly simple.

1. Make sure NetBeans is not running.

2. Make sure the jdk is installed.

3. Determine the location of the jdk:
The jdk location can be determined by entering the following (in Terminal):

$ /usr/libexec/java_home

For my system, the output was:
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home

4. Edit the NetBeans configuration file to indicate the location of the jdk.
Near the bottom of this Netbeans configuration file (or equivalent for your NetBeans version):
/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
Comment out the following line (insert a # before the first character):

#netbeans_jdkhome="/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/bin/jre"

Then, add the following line (or equivalent for your jdk version):

netbeans_jkdhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home"

Then, save and exit the editor.

5. Start NetBeans (no more popup window indicating that the jdk is missing).



回答5:


This worked for me

1. install full JDK
2. either edit <netbeans-IDE-installation>/etc/netbeans.conf
    2.1 unmark netbeans_jdkhome
    2.2 link to JDK location e.g. /usr/local/share/java/jdk1.6.0_07/ 
3. or use --jdkhome command-line option e.g. ./bin/netbeans --jdkhome /usr/local/share/java/jdk1.6.0_07/ 

take care with the "/" at the end

More info in http://wiki.netbeans.org/FaqRunningOnJre




回答6:


Ubuntu 16.04 LTS:

  1. Uninstall the netbeans you have.
  2. Delete .cache/netbeans folder
  3. Download http://www.oracle.com/technetwork/java/javase/downloads/jdk-netbeans-jsp-142931.html
  4. Install your download



回答7:


I have this problem to. But now i resolove this problem with edit one line.

  1. Find and open this file /etc/netbeans.conf
  2. If you see netbeans_jdkhome="C:\Program Files\Java\jre1.8.0_151" replace netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_131"
  3. Save as adminstrator

Problem reseloved




回答8:


In mid April 2019, Oracle has changed the JDK's licence. However, I was still able to solve this issue with NetBeans 11 and the JDK 12's open source build on my Windows machine. Just downloaded the open source JDK from https://jdk.java.net/ and extracted it. Then, in my NetBeans config file, I typed in the path to the extracted directory (NOT the "bin" folder!).



来源:https://stackoverflow.com/questions/33744455/the-jdk-is-missing-and-is-required-to-run-some-netbeans-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!