Reputation: 301
Netbeans 8.0.2 shows this error on startup Netbeans 8.0.2 error on startup. I searched for this error, but nothing works for me.
I modified the netbeans_jdkhome in netbeans.conf
file, but nothing. Then uncommented it, nothing. The error keeps showing up. It´s like there is another netbeans.conf file, but I don´t know where.
I´m running Windows 10 and have JDK 1.8 installed in "C:\Program Files\Java\jdk1.8.0_101" .
Upvotes: 20
Views: 37024
Reputation: 1
I have an easier solution by just passing the parameter --jdkhome to netbeans executable (inside './bin' folder):
netbeans64.exe --jdkhome %JAVA_HOME%
You can create a runNetbeans.bat file at netbeans root directory with the following content:
%~dp0/bin/netbeans64.exe --jdkhome %JAVA_HOME%
PS: You can pass the directory of your JDK, replacing the JAVA_HOME environment. PS2: Tested on Netbeans 12.
Upvotes: 0
Reputation: 1
If you cant edit netbeans.conf for some reason, try re-installing netbeans
Upvotes: 0
Reputation: 61
You may have a problem getting your edit to stick because you need Administrator Privilege to edit the netbeans.conf file.
Windows 10:
Upvotes: 6
Reputation: 27423
First attempt at a powershell solution.
# fix path to jdk in netbeans.conf
# netbeans doesn't like unicode (utf-16)
$conf = Get-Content 'C:\Program Files (x86)\NetBeans 8.2\etc\netbeans.conf'
# string version of $jdk will have last dir found if there's more than one
$jdk = get-item 'C:\Program Files (x86)\Java\jdk*'
# `" to embed "
set-content 'C:\Program Files (x86)\NetBeans 8.2\etc\netbeans.conf' (
$conf -replace 'netbeans_jdkhome=.*',"netbeans_jdkhome=`"$jdk`"")
if (-not $?) { exit 1 }
Upvotes: 0
Reputation: 41
I found a decent solution for Windows users.
Go to your NetBeans install folder (for instance: C:\Program Files\NetBeans 8.0.2\etc
), open the file netbeans.conf
then just comment out the line:
netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_101"
to
#netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_101"
The '#' is for comment. You will see this in the file.
Then just run the NetBeans IDE as usual.
Upvotes: 3
Reputation: 77
You cannot just run netbeans64. You have to manually edit the CONF file in netbeans\etc folder. And set jdkhome variable. Then the installation goes smoothly.
Ignore all my previous comments. Sorry.
Upvotes: 0
Reputation: 1
To fix Netbeans IDE - invalid jdkhome specified
just find your netbeans.config
and change the file path, like below:
netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_161"
netbeans_jdkhome="C:\Program Files\Java\jdk-10"
Upvotes: 0
Reputation: 381
go to C:\Program Files\NetBeans 8.0.2\etc
, open the file netbeans.conf
then change netbeans_jdkhome
to the path of your JDK, netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_101"
if you are not sure about the version of jdk
, you can find it by typing in CMD java -version
Upvotes: 38
Reputation: 153
Try to set environment variable in cmd:
setx JAVA_HOME C:\Program Files\Java\jdk1.8.0_101
I think you alredy have JAVA_HOME, but path is C:\Program Files\Java\jdk1.7.0_15.
You can check it in cmd. Just type it:
set JAVA_HOME
Upvotes: 1