19

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" .

roottraveller
  • 7,942
  • 7
  • 60
  • 65
Jiří Mačák
  • 191
  • 1
  • 1
  • 4

9 Answers9

34

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

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
CY15
  • 341
  • 3
  • 3
  • As I have written in my question, I already tried modifying 'netbeans_jdkhome' variable in netbeans.conf. However, It still does not work. – Jiří Mačák Jun 01 '17 at 10:31
  • @JiříMačák changing netbeans_jdkhome in netbeans.conf file solves problem. As you said there may exists another installation of netbeans in your computer. – Barbaros Özhan Oct 06 '17 at 06:29
6

You may have a problem getting your edit to stick because you need Administrator Privilege to edit the netbeans.conf file.

Windows 10:

  1. left mouse-click on the windows button on the task bar
  2. type cmd.exe
  3. windows search should list "Command Prompt - Desktop App"
  4. right mouse-click on "Command Prompt - Desktop App"
  5. select "run as administrator"
  6. select the Yes button from User Account Control dialog box
  7. from the command prompt change directory to where the netbeans.conf file is.
  8. CD "C:\Program Files\NetBeans 8.0.2\etc"
  9. type: notepad netbeans.conf
  10. search for netbeans_jdkhome=
  11. add the path to your jdk: netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_181"
  12. save netbeans.conf
  13. start Netbeans
Congdar
  • 61
  • 1
  • 2
2

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.

Mihai Chelaru
  • 7,614
  • 14
  • 45
  • 51
Nixon Nelson
  • 21
  • 1
  • 4
1

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 
learp
  • 153
  • 8
  • Thank you for response. I already have the JAVA_HOME set to C:\Program Files\Java\jdk1.8.0_101. – Jiří Mačák Oct 31 '16 at 12:57
  • This has nothing to do with netbeans jdkhome. JAVA_HOME has different purpose. correct answer is posted by CY15 – AaA Jul 26 '19 at 02:28
0

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"

ikos23
  • 4,879
  • 10
  • 41
  • 60
0

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.

0

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 }
js2010
  • 23,033
  • 6
  • 64
  • 66
0

If you cant edit netbeans.conf for some reason, try re-installing netbeans

GavenJr
  • 1
  • 1
0

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.

Asfixia
  • 1
  • 1