Cannot find java. Please use the --jdkhome switch

后端 未结 10 1577
生来不讨喜
生来不讨喜 2020-12-15 04:43

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
         


        
相关标签:
10条回答
  • 2020-12-15 04:54

    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.

    0 讨论(0)
  • 2020-12-15 04:56

    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

    0 讨论(0)
  • 2020-12-15 04:57

    What worked for me is:

    • make sure java path is available:
    $ which java
    /usr/bin/java
    
    • then in etc/netbeans.conf make sure netbeans_jdkhome is commented out
    • in Finder go to /bin/ click on netbeans (terminal icon)

    You would expect ./netbeans --jdkhome=/usr/bin/java to work, but it doesn't for some reason.

    0 讨论(0)
  • 2020-12-15 05:00
    1. Go to the netbeans installation directory
    2. Find configuration file [installation-directory]/etc/netbeans.conf
    3. towards the end find the line netbeans_jdkhome=...
    4. comment this line line using '#'
    5. now run netbeans. launcher will find jdk itself (from $JDK_HOME/$JAVA_HOME) environment variable

    example:

    sudo vim /usr/local/netbeans-8.2/etc/netbeans.conf
    
    0 讨论(0)
  • 2020-12-15 05:01

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

    0 讨论(0)
  • 2020-12-15 05:03

    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

    0 讨论(0)
提交回复
热议问题