简体   繁体   English

无法让NetBeans找出要使用的更新Java

[英]Can't get NetBeans to figure out which updated Java to use

I'm using NetBeans 8.0.2 and every time I update Java, it installs into a folder named after its version number, then when I open NetBeans it says "Cannot find Java x or higher". 我使用的是NetBeans 8.0.2,每次更新Java时,它将安装到以版本号命名的文件夹中,然后在打开NetBeans时显示“找不到Java x或更高版本”。

I've read that I can add a line to the etc/netbeans.conf file specifying the Java folder, but that means I have to change it every time Java updates. 我已经读到可以在etc / netbeans.conf文件中添加一行来指定Java文件夹,但这意味着每次Java更新时都必须对其进行更改。 Commenting it out doesn't help. 注释掉无济于事。

Is there a better solution for this? 有更好的解决方案吗? I'd think NetBeans (like most Java programs) can figure out where the latest Java is and use that; 我认为NetBeans(像大多数Java程序一样)可以弄清楚最新的Java在哪里并使用它。 I'm not sure if I can use environment variables or quite how I would get that to work yet. 我不确定是否可以使用环境变量,或者不确定如何使用它。

The way I solve this is to install the JDK in the same directory each time there is a new version. 我解决此问题的方法是,每次有新版本时,都将JDK安装在同一目录中。 I uninstall the old JDK first, then install the new JDK version in c:\\jdk8. 我先卸载旧的JDK,然后在c:\\ jdk8中安装新的JDK版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM