I had the same problem because two JDK versions were installed on my pc, so changing the Netbeans needed JDK to lower version solved my problem. here are my passed steps: Step One In your Netbeans home directory (for example, C:\Program Files\NetBeans 8.1), open up the netbeans.
Solution to my problem: Remove MinGW and ALL of it's components, and also remove the folder x:\MinGW. Then install Cygwin, choose the packages you need, tutorial can be found on https://netbeans.org/community/releases/73/cpp-setup-instructions.html#cygwin or YouTube about which packages you need.
EDIT: The solution is to install JDK 8, as JDK 9 and beyond are currently not supported.
If however, you already have installed JDK 8, then kindly follow the steps outlined below.
The reason is that there is a conflict with the base JDK that NetBeans starts with. You have to set it to a lower version.
"C:\Program Files\NetBeans 8.2\etc"
, or wherever NetBeans is installed.netbeans.conf
file.netbeans_jdkhome
and replace the JDK path there with "C:\Program Files\Java\jdk1.8.0_152"
, or wherever your JDK is installed. Be sure to use the right path, or you will run into problems. Here, JDK 1.8.0_152
is installed.JDK-9
.yes
or ok
.Or you can remove JDK-9
from your pc and install JDK-8
.
As the other people said, NetBeans is always going to use the latest version of JDK installed (currently JDK9) which is not working with NetBeans 8.2 and is causing problems as you guys mentioned.
You can solve this problem by forcing NetBeans to use JDK8 instead of deleting JDK9!
You just have to edit netbeans.conf
file:
MacOS /Applications/NetBeans/NetBeans8.2.app/Contents/Resources/NetBeans/etc
Windows C:\Program Files\NetBeans 8.2\etc\
Open netbeans.conf with your favourite editor and find this line: netbeans_jdkhome="/path/to/jdk"
Remove # sign in front of it and modify it by typing your desired JDK version (JDK8) home location.
Im not sure why is JDK9 not working with NetBeans8.2, but if I found out I will write it here...
Default JDK locations:
Mac OS ↴
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
Windows ↴
C:\Program Files\Java\jdk1.8.0_152
I've used jdk1.8.0_152 as example
I had the same problem I installed NetBeans 8.2 on macOS High Sierra, and by default settings, NetBeans will work with the latest JDK release (currently JDK 9).
What I did was forcing NetBeans to use JDK 8, you must config your netbeans.conf
file, you can find it on:
/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
You need to uncomment and update your path to JDK, you will find yours at:
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
Just save it, restart NetBeans and you are done!
If you run in linux, open file netbeans.conf using nano or anything else.
nano netbeans-8.2/etc/netbeans.conf
and edit jdkhome or directory for jdk
netbeans_jdkhome="/usr/lib/jvm/java-1.8.0-openjdk-amd64"
you can check your jdk version with
java -version
or
ls /usr/lib/jvm
Java SE Development Kit 9 is not compatible with the Netbeans IDE 8.2.
My Solution:
Faced same issue with jdk 10. While installing netbeans prompted for jdk default location was taken as jdk 10. This was the issue, it should be jdk8 (1.8).
C:\Program Files\NetBeans 8.2\etc\netbeans.conf
# netbeans_jdkhome="C:\Program Files\Java\jdk-10.0.1"
netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_171"
Note: If the above .conf file is not editable, then use Administrator mode. I use Notepad++, it prompted for restarting Notepad++ in Administrator mode, then save worked fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With