RSS Entries RSS
RSS Subscribe by Email

Change the NetBeans Default JDK

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″

Share and Enjoy:
  • Add to favorites
  • HackerNews
  • DZone
  • Reddit
  • del.icio.us
  • StumbleUpon
  • Slashdot
  • Digg
  • Google Bookmarks
  • Facebook

Tags:

14 Comments »

  1. Martin said,

    January 31, 2009 at 3:15 pm

    Thanks ! Useful !

  2. Lloyd said,

    February 15, 2009 at 3:33 pm

    Thanks I nearly went insane looking through the oprions to change the default jdk

  3. ashish said,

    May 14, 2009 at 7:44 am

    Thanks a million buddy this was great. I had to other way round 1.6 -> 1.5

  4. Matt said,

    August 13, 2009 at 11:02 am

    Thanks a bunch, saved me a lot of time.

  5. Sterling said,

    August 30, 2009 at 10:07 pm

    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.

  6. Ben said,

    August 31, 2009 at 8:28 am

    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.

  7. Darryl said,

    October 29, 2009 at 7:52 am

    Thanks so much! This was really useful!

  8. sugih said,

    January 19, 2010 at 2:11 pm

    Thanks for sharing! It works after I followed your comment on Sterling’s

  9. Black said,

    February 10, 2010 at 6:00 pm

    Muchas gracias, andaba buscando una solucion para IDE netbeans al instalar una nueva version de JDK

  10. Pietro said,

    March 25, 2010 at 3:46 am

    great trick! Thank you

  11. ymtoh said,

    April 21, 2010 at 1:39 am

    thanx mate.. i was looking for the configuration insanely…

  12. Man0z said,

    June 1, 2010 at 12:31 am

    thx a lot! very useful

  13. James Pridgen said,

    June 15, 2010 at 5:48 am

    Thanks for that…I just had the same problem.

  14. Andrei said,

    August 28, 2010 at 10:07 pm

    you can change your default path by editing netbeansdir/etc/netbeans.conf str8 forward from there

RSS feed for comments on this post · TrackBack URL

Leave a Comment