Change the NetBeans Default JDK
03/04/2008
A client sent me some code today to update. He was using the NetBeans, so I downloaded the IDE and fired it up to open the project he’d sent me. Unfortunately, the project wouldn’t compile because he’d written the code in Java 6 while NetBeans was using Java 5. I couldn’t find a NetBeans menu to update the setting, but rather found that the fix is to add the following in NetBean’s etc/netbeans.conf file:
# Default location of JDK, can be overridden by using --jdkhome <dir>:
netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_05"
Thanks ! Useful !
Thanks I nearly went insane looking through the oprions to change the default jdk
Thanks a million buddy this was great. I had to other way round 1.6 -> 1.5
Thanks a bunch, saved me a lot of time.
Whenever I run that command it says “File not found”. My path is
C:\Java\jre6\jdk1.6.0_12
Is it because I’m pointing to a folder? Do I need to RUN netbeans.conf? Whenever I try to do that, I don’t have the right program to run it and the web can’t find one apparently.
Sterling, it’s not a command that you run. You need to open netbeans.conf in a text editor such as NotePad or WordPad and add that line to the file. You do not need to run netbeans.conf. When NetBeans starts up, it will look in that file to see which JDK it should point to.
Thanks so much! This was really useful!
Thanks for sharing! It works after I followed your comment on Sterling’s
Muchas gracias, andaba buscando una solucion para IDE netbeans al instalar una nueva version de JDK
great trick! Thank you
thanx mate.. i was looking for the configuration insanely…
thx a lot! very useful
Thanks for that…I just had the same problem.
you can change your default path by editing netbeansdir/etc/netbeans.conf str8 forward from there
wow that’s great!!
thanks for this
That is a great tip! Saved me hours of my time. Thanks a lot.
Worked for me too — thanks for sharing. Since my install dir was customized, I found the file here: C:\apps\NetBeans_6_9_1\etc\netbeans.conf
Big help!!!
thz…
How i can edit that file??????????
I was unable to edit the file, whir word or WHAT??
help
Paul, if you’re on Windows, you can use Notepad, Wordpad, or download another text editor like Notepad++.
thanks, really useful
merci infiniment.
You are a life server! In Africa we say ‘zikomo’ meaning thank you
thanks a lots .. its worked
Thanks a lot.Its work for me
exactly! thanks a thousand dude! 😀
It worked. Woohoo!
oh THANK YOU thank you thank you!! 😀
you, sir, have just made my day. I had a problem with the upload, and I was trying to revert from Java 1.7 to Java 1.6, but Netbeans was not obeying, and now with this fix it’s working again! OH THANK YOU LORD!! 😀
Hello dear, it work very well and thank you.in linux you can change it with edit this file :
/usr/local/netbeans-7.0.1/etc/netbeans.conf
I dont understand this. I am a mac user. So what should i do?
Thanks
This is still a useful tip well over four years (and several NetBeans versions) after it was posted!
Thank You 🙂
I did observe some strange side-effects (in NB7.1.1) to the “tools->java platforms” dialog concerning javafx, but I don’t think it will affect me, and NB7.2 is rigth around the corner anyway so…
Thanks bro