Netbeans and default JDK
Since Netbeans 6.1 for Mac OS X still comes with JDK 1.5 and I wanted 1.6 I went to Tools > Java Platforms and added 1.6 (/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home). But if I wanted to change 1.6 to the default JDK it just wasn’t possible from within Netbeans itself. Browsing the Help-section I found this interesting piece:
You can set the IDE’s default platform by running the IDE with the –jdkhome switch on the command line or by entering the path to the JDK in the netbeans_j2sdkhome property of your INSTALLATION_DIRECTORY/etc/netbeans.conf file.
Since I didn’t wanted to start Netbeans with an extra parameter I went to my Applications folder and right clicked on Netbeans 6.1.app choosing “Show Package contents”. Navigating to Contents/Resources/etc/ I found the said netbeans.conf. Inside there was this line:
# Default location of JDK, can be overridden by using --jdkhome < dir >:
netbeans_jdkhome=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
Just changed it too /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home and restarted Netbeans et voila: 1.6 was the default JDK.
Update: In Netbeans 6.5 netbeans.conf can be found in Contents/Resources/NetBeans/etc
June 23rd, 2008 at 15:08
This is just what I was looking for.
I have been pulling my hair out for two hours.
Thank you for sharing this.
silverprince
sydney, australia
July 6th, 2008 at 21:53
Thanks for the tip! With all the wonderful things that NetBeans can do, its amazing how a simple thing like setting the default JDK is overlooked. I use NetBeans for my java class I teach and having to change the JDK in the properties every time is REALLY annoying (almost all my students use a PC to write their code, but I use a Mac for marking).
I love the internet.
July 20th, 2008 at 23:37
I find this blog very interesting, i will be here everyday till now. Greetings
November 20th, 2008 at 13:42
Excellent tip - this is exactly what I was after (most searches turned up results telling me how to add another platform to build/compile to - but not how to change the platform NetBeans actually runs on). Strange that you can’t do this within the IDE itself - but you’ve saved me some time! Thanks.
November 29th, 2008 at 7:15
thanks a lot. this is what i was looking for. i tried to figure out the problem by view so many web sites by googling but no luck until i found this. thanks once again.
razi
February 14th, 2009 at 0:45
Thank you so much. I am a .Net developer trying to learn Java. I got an excellent book ‘Murach’s Java SE6′ but until your comment I had to go changing settings for every project!!! Thank you so much!!!
February 21st, 2009 at 23:01
Thanks. I needed this
April 5th, 2009 at 4:18
Thnks!
May 22nd, 2009 at 20:24
Your blog is very interresting for me, i will come back here..
July 6th, 2009 at 18:38
XH5mG6 cool, i will bookmark it,
August 31st, 2009 at 3:59
How long have you been blogging…your good at it.
November 24th, 2009 at 8:27
I really see the logic in your argument but I think you’ve painted your strokes
January 6th, 2010 at 16:03
Взял себе
February 3rd, 2010 at 11:07
просто супер. заставляет задуматься.. спасибо!
February 3rd, 2010 at 15:47
Супер, мне кажется это отличная мысль
February 3rd, 2010 at 19:28
Вот это да! Крутая статейка!
February 4th, 2010 at 18:37
Хороший материал у вас тут опубликован, все интересно и грамотно изложено, за что вас благодарю. Пишите еще, я подписался на rss-ленту.
February 4th, 2010 at 21:39
Великолепный пост здесь у вас написан, всё очень интересно и грамотно изложено, за что вас благодарю. Пишите еще, я подписался на rss-ленту.
April 7th, 2010 at 2:23
Возможно такое будет реализвано через 3-5 лет. Работать надо!)
May 9th, 2010 at 19:56
I find this blog very interesting, i will be here everyday till now. Greetings
May 17th, 2010 at 16:21
>> I find this blog very interesting, i will be here everyday till now. Greetings
It agree! Write still!
June 16th, 2010 at 18:46
gives use a perfect website decent Gives thanks for the working hard to assist me
July 13th, 2010 at 6:51
Hasslem, Miller, and 3 second round picks……ya they are concerned. Only production coming out of them is the amount of fouls they can use.
July 20th, 2010 at 17:02
Thanks a lot for providing such an excellent information!