How to set the JDK Netbeans runs on?
I have older NB6.7, NB6.9, NB7.0, which used to run on jdk1.6.0_21 and jdk1.6.0_25. Now I've removed those JDKs and only have jdk1.6.0_26 and jdk1.7.0 left, but I still want to keep the older NBs, but now when I run them, I get this message:
"Cannot locate java installation in specified jdkhome C:Program Files (x86)Javajdk1.6.0_25 Do you want to try to use default version ?"
I tried to find where it's looking for the "jdk1.6.0_25", and updated a few config files in "C:Program Files (x86)NetBeans 6.7" and "C:UsersUSER.nbiregistry.xml", and yet the message keeps coming, my question is, where and what do I need to change to point it to: C:Program Files (x86)Javajdk1.6.0_26
?
Thanks to KasunBG's tip, I found the solution in the "suggested" link, update the following file (replace 7.x with your Netbeans version) :
C:Program FilesNetBeans 7.xetcnetbeans.conf
Change the following line to point it where your java installation is :
netbeans_jdkhome="C:Program FilesJavajdk1.7xxxxx"
You may need Administrator privileges to edit netbeans.conf
Go to Tools
-> Java Platforms
. There, click on Add Platform, point it to C:Program Files (x86)Javajdk1.6.0_25
. You can either set the another JDK version or remove existing versions.
Another solution suggested in the oracle (sun) site is,
netbeans.exe --jdkhome "C:Program Filesjdk1.6.0_20"
I tried this on 6.9.1. You may change the JDK per project as well. You need to set the available JDKs via Java Platforms
dialog. Then, go to Run
-> Set Project Configuration
-> Customize
. After that, in the opened Dialog box go to Build
-> Compile
. Set the version.
For those not using Windows the file to change is netbeans-8.0/etc/netbeans.conf
and the line(s) to change is:
netbeans_jdkhome="/usr/lib/jvm/java-8-oracle"
commenting out the old value and inserting the new value
链接地址: http://www.djcxy.com/p/66650.html上一篇: 将复杂类型XSD内联到WSDL中
下一篇: 如何设置运行JDK Netbeans?