我刚刚在CentOS 6.5上安装了Netbeans 8.0.2.
当我尝试运行它时,我收到了消息
Cannot find java. Please use the --jdkhome switch
我有/usr/share/java-1.7.0所以我键入了
/usr/local/netbeans-8.0.2/bin/netbeans --jdkhome /usr/share/java-1.7.0
还有
Cannot find java. Please use the --jdkhome switch
我还有/root/Downloads/jdk1.8.0_40,它允许我安装Netbeans.但是,当我输入
/usr/local/netbeans-8.0.2/bin/netbeans --jdkhome /root/Downloads/jdk1.8.0_40
我还是得到的
Cannot find java. Please use the --jdkhome switch
我试过了
whereis java
得到了
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz
然而
/usr/local/netbeans-8.0.2/bin/netbeans --jdkhome /usr/bin/java
仍然生产
Cannot find java. Please use the --jdkhome switch.
解决方法:
我建议您在netbeans.conf配置文件中更改NetBeans使用的JDK配置:
netbeans_jdkhome="C:\Program Files\Java\..."