I have just installed Netbeans 8.0.2 on CentOS 6.5.
When I try to run it, I get the message
Cannot find java. Please use the --jdkhome switch
In my case, I had installed *ahem* OpenJDK, but the bin folder was full of symlinks to the bundled JRE and the actual JDK was nowhere to be found.
When I see a directory structure with bin
and jre
subdirectories I expect this to be the JDK installation, because JRE installations on Windows looked different. But in this case it was the JRE installation as found out by apt search
. After installing openjdk-8-jre the simlinks were replaced and the directory structure otherwise stayed the same.
If like me, you got that message after installing jenv,
simply add netbeans_jdkhome="$JAVA_HOME"
to your [netbeans-installation-directory]/etc/netbeans.conf
file
What worked for me is:
java
path is available:$ which java
/usr/bin/java
netbeans_jdkhome
is commented outYou would expect ./netbeans --jdkhome=/usr/bin/java
to work, but it doesn't for some reason.
example:
sudo vim /usr/local/netbeans-8.2/etc/netbeans.conf
NetBeans 8.2 - Cannot locate java installation in specified jdkhome?
Answer: Edit the netbeans.conf file.
Close NetBeans, start Notepad or another text editor as Administrator. Right click on the Notepad application and choose "Run as administrator" and then open netbeans.conf with it. Change netbeans_jdkhome=”C:\Program Files...whatever”.
Check the setting in your user config /home/username/.netbeans/version/etc/netbeans.conf
I had the problem where I was specifying the location globally, but my user setting was overriding the global setting.
CentOS 7/Netbeans 8.1