The JDK is missing and is required to run some NetBeans modules
Asked Answered
C

10

50

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
Cortez answered 16/11, 2015 at 20:55 Comment(5)
You have the JRE installed, but you (also) need the JDKMirk
To quickly check if you have a JDK, try javac -version - the Java compiler is part of the JDK, not part of the JRE.Ablaut
Added that command result to the questionCortez
check the file etc/netbeans.conf under where you installed netbeans and find the line that starts with netbeans_jdkhome= Is that pointing to the correct JDK directory?Aeonian
It was probably that. I uninstalled and installed the netbeans that comes with JDK and it worked... thanks anywayCortez
I
84

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

Inge answered 21/3, 2016 at 7:1 Comment(8)
netbeans_jdkhome = should be path of JDK?Bleacher
On my system using open-jdk the path is: /usr/lib/jvm/java-8-openjdk-amd64Okay
On Windows it's in the Netbeans installation directory e.g. C:\Program Files\NetBeans 8.1\etcLarimor
Yes this works. You can also enter this as [netbeans_jdkhome="/usr/lib/jvm/default-java"] where [default-java] is a symbolic link to the actual JDK directory. This is what I did for Ubuntu 16.04.Bookstore
This works, on Ubuntu with netbeans 8.2 the path is ~/netbeans for netbeans.conf and /usr/lib/jvm/java-8-openjdk-amd64/ for JDKHereinto
@Okay sorry to bother you, I did try with openJDK, but it does not work for some reason. Netbeans 8.2 + latest OpenJDK available from Ubuntu 16.04 apt. Any idea what may be wrong?Unthinking
Did the NB install succeed? If should require the JDK to be set during the install and then it would be rare for things to not work, if the install did not succeed what error are you getting? What is the result of running the command: "update-java-alternatives -l" in the shell? It should list all installed java versions... Review this site: digitalocean.com/community/tutorials/… also stability is good for deployment but for development cutting edge I find to be the best (Ubuntu 17.04).Okay
On Kali Linux 2017.1, netbeans.conf was in (/usr/local/netbeans-8.2/etc) and JDK in (/usr/lib/jvm/java-8-openjdk-amd64)Hormone
R
7

[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).
Radu answered 9/2, 2017 at 4:6 Comment(1)
It worked using netbeans 8.2 RC, JDK 1.8, and macOS BigSur 11.0.1 Thanks a lot!!Golding
B
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".

Babbling answered 14/12, 2017 at 16:2 Comment(0)
L
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
Legault answered 12/11, 2017 at 6:51 Comment(0)
N
1

This error showed up when I updated the Mac to Mojave. To fix, I edited the netbeans.conf file with the current jdk by using Terminal to find the correct jdk. Type /usr/libexec/java_home -V

Here was my output.

Matching Java Virtual Machines (4):
    1.8.311.11 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    1.8.0_131 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
    1.8.0_25 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home
    1.7.0_79 (x86_64) "Oracle Corporation" - "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

Entering the first jdk listed did not work. I edited the conf file with the second one listed: netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home"

Restarted Netbeans. That fixed it.

Necrophobia answered 14/1, 2022 at 15:39 Comment(0)
A
0

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

Antlion answered 7/12, 2016 at 3:33 Comment(0)
C
0

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
Combo answered 11/9, 2017 at 1:57 Comment(1)
i dont think .cache folder related to this, i just experiencing this after deleting .cache folder and reinstall netbeansMinus
H
0

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

Hymnody answered 5/11, 2017 at 13:2 Comment(0)
G
0

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!).

Gusto answered 2/5, 2019 at 9:59 Comment(0)
M
0

I resolved this problem by changing default version of JRE and JDK that I'm using to 11.x.x with following commands:

sudo update-alternatives --config java
sudo update-alternatives --config javac
Monolayer answered 5/6, 2020 at 17:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.