简体   繁体   English

如何在NetBeans 8中更改默认JDK

[英]How to change default JDK in NetBeans 8

I've been running NetBeans 8.0.2 on 64-bit Windows 7 with JDK 1.7.0_51 for some time. 我已经使用JDK 1.7.0_51在64位Windows 7上运行NetBeans 8.0.2一段时间了。 I recently installed JDK 1.7.0_79 and added it as a new platform in NetBeans. 我最近安装了JDK 1.7.0_79并将其添加为NetBeans中的新平台。 I would like that to also be the Default JDK, but the old way of accomplishing that - changing the netbeans_jdkhome reference in C:\\Program Files\\NetBeans 8.0\\etc\\netbeans.conf - no longer works. 我希望它也是默认的 JDK,但是实现这一目标的旧方法 - 更改C:\\ Program Files \\ NetBeans 8.0 \\ etc \\ netbeans.conf中的netbeans_jdkhome引用 - 不再有效。 I've searched high and low for some other configuration file that contains a reference to the 1.7.0_51 JDK, but have been unable to find any. 我搜索了一些其他配置文件的高低,其中包含对1.7.0_51 JDK的引用,但一直无法找到。

The original method of updating C:\\Program Files\\NetBeans 8.0\\etc\\netbeans.conf to reference a new JDK continues to work. 更新C:\\ Program Files \\ NetBeans 8.0 \\ etc \\ netbeans.conf以引用新JDK的原始方法继续有效。 What might be happening if it appears not to is Windows holding onto two separate copies of the file - the original version and the one modified to reference the new JDK, with NetBeans reading the original version. 如果看起来不是Windows,那么可能会发生的事情是Windows保留文件的两个单独副本 - 原始版本和修改为引用新JDK的版本,NetBeans读取原始版本。 This can happen if you try to edit netbeans.conf when the editor you use to update it is not running with Administrator privileges. 如果您在用于更新它的编辑器未以管理员权限运行时尝试编辑netbeans.conf,则会发生这种情况。 This is bizarre, confusing and I dare say dangerous behavior on the part of Windows. 这是奇怪的,令人困惑的,我敢说Windows的危险行为。 It might even be a bug. 它甚至可能是一个错误。

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

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