简体   繁体   English

除命令行外,我在哪里可以设置用于运行Netbeans的JRE / JDK?

[英]Where can I set the JRE/JDK which is used to run Netbeans besides the command line?

First of all, I know about the command line parameter, but I don't want to use it because I want to learn, not just get it done, so... 首先,我知道命令行参数,但我不想使用它,因为我想学习,而不仅仅是完成它,所以...

Where can I set the JRE/JDK which is used to run Netbeans? 我在哪里可以设置用于运行Netbeans的JRE / JDK?

A little background: 一点背景:

  1. I installed JDK 1.6_10 (The system is Windows Vista Business 64) 我安装了JDK 1.6_10(系统是Windows Vista Business 64)
  2. I installed Netbeans 6.5 我安装了Netbeans 6.5
  3. After a few weeks I uninstalled Netbeans 6.5 (some problems which I hope to solve by a reinstall) 几周后我卸载了Netbeans 6.5(我希望通过重新安装解决一些问题)
  4. I also uninstalled JDK 1.6_10 and installed 1.6_11 instead. 我还卸载了JDK 1.6_10并安装了1.6_11。
  5. I reinstalled Netbeans 6.5 我重新安装了Netbeans 6.5
  6. Now I cannot start Netbeans because it insists of using the old JDK. 现在我无法启动Netbeans,因为它坚持使用旧的JDK。 (Trying to use the default version doesn't work either. JAVA_HOME is set to 1.6_11) (尝试使用默认版本也不起作用.JAVA_HOME设置为1.6_11)

Try setting netbeans_jdkhome in {NetBeans directory}/etc/netbeans.conf. 尝试在{NetBeans目录} /etc/netbeans.conf中设置netbeans_jdkhome。

# Default location of JDK, can be overridden by using --jdkhome : netbeans_jdkhome="..." # (omitted path, as I have Java in a non-standard location) #JDK的默认位置,可以使用--jdkhome覆盖:netbeans_jdkhome =“...”#(省略路径,因为我在非标准位置有Java)

Based on the voted answer, here's what I did on my Mac and it worked... 基于投票的答案,这是我在Mac上所做的,它起作用了......

(download JDK from Oracle)
$ vi /Applications/NetBeans/NetBeans\ 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
[...]
#netbeans_jdkhome="/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/bin/jre"
netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/"

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

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