I am using Netbeans 6.7. I had f开发者_开发知识库irst installed Java 1.5 before installing Netbeans. When i installed Netbeans it took Java 1.5 as the default version. Then i installed Java 1.6 on my machine. I need to change the default JDK of my netbeans to 1.6 not only to a specific project but to the whole Netbeans application.
You can change the JDK for Netbeans by modifying the config file:
- Open
netbeans.conf
file available underetc
folder inside the NetBeans installation. - Modify the
netbeans_jdkhome
variable to point to new JDK path, and then - Restart your Netbeans.
In my Windows 7 box I found netbeans.conf in <Drive>:\<Program Files folder>\<NetBeans installation folder>\etc
. Thanks all.
For anyone on Mac OS X, you can find netbeans.conf
here:
/Applications/NetBeans/NetBeans <version>.app/Contents/Resources/NetBeans/etc/netbeans.conf
In case anyone needs to know :)
open etc folder in netbeans folder then edit the netbeans.conf with notepad and you will find a line like this :
Default location of JDK, can be overridden by using --jdkhome :
netbeans_jdkhome="G:\Program Files\Java\jdk1.6.0_13"
here you can set your jdk version.
on Fedora it is currently impossible to set a new jdk-HOME to some sdk. They designed it such that it will always break. Try --jdkhome [whatever] but in all likelihood it will break and show some cryptic nonsensical error message as usual.
Fix this by moving my jdk folder to other disk
Either change the jdk home in the application preferences or look for the application's config files.
On Mac OS X, its in a netbeans.conf
file, and look for the jdk home
value.
here:
精彩评论