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

你离开我真会死。 提交于 2019-11-27 03:09:56

问题


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?

A little background:

  1. I installed JDK 1.6_10 (The system is Windows Vista Business 64)
  2. I installed Netbeans 6.5
  3. After a few weeks I uninstalled Netbeans 6.5 (some problems which I hope to solve by a reinstall)
  4. I also uninstalled JDK 1.6_10 and installed 1.6_11 instead.
  5. I reinstalled Netbeans 6.5
  6. Now I cannot start Netbeans because it insists of using the old JDK. (Trying to use the default version doesn't work either. JAVA_HOME is set to 1.6_11)

回答1:


Try setting netbeans_jdkhome in {NetBeans directory}/etc/netbeans.conf.

# Default location of JDK, can be overridden by using --jdkhome : netbeans_jdkhome="..." # (omitted path, as I have Java in a non-standard location)




回答2:


Based on the voted answer, here's what I did on my Mac and it worked...

(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/"


来源:https://stackoverflow.com/questions/504087/where-can-i-set-the-jre-jdk-which-is-used-to-run-netbeans-besides-the-command-li

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!