Cannot find java. Please use the --jdkhome switch

后端 未结 10 1578
生来不讨喜
生来不讨喜 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 05:09

    I do recommend you to change the configuration of JDK used by NetBeans in netbeans.conf config file:

    netbeans_jdkhome="C:\Program Files\Java\..."
    
    0 讨论(0)
  • 2020-12-15 05:11

    With the Netbeans 10, commenting out the netbeans_jdkhome setting in .../etc/netbeans.conf doesn't do the job anymore. It is necessary to specify the right directory depending of 32/64 bitness.

    E.g. for 64 bit application: netbeans_jdkhome="C:\Program Files\AdoptOpenJDK\jdk8u202-b08"

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

    Try Java SE Runtime Environment 8. It fixed it for me.

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

    ATTENTION MAC OS USERS


    First, please remember that in a Mac computer the netbeans.conf file is stored at

    /Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
    

    (if you had used the default installation package.)

    Then, also remember that the directory you MUST use on either "netbeans_jdkhome" or "--jdkhome" it's NOT the /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/ but the following one:

    /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home //<-- Please, notice the /Contents/Home at the end. That's the "trick"!
    

    Note: of course, you must change the versions for both NetBeans and JDK you're using.

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