Getting Netbeans 6.9 to work on OS X 10.5.8

netbeans69osxerror

After downloading and installing Netbeans 6.9 I launched the app. It bounced a couple of times in my dock as dreams of exciting new features danced in my head. Then… nothing, well not quite nothing, I received a message informing me that:

“Java 6 Standard Edition or newer required. Cannot run on older versions of Java than Java 6 Standard Edition. Please install Java 6 Standard Edition or newer or use –jdkhome switch to point to its installation directory.”

How to solve this issue:

Step 1. Figure out which version of Java you have

Open Terminal.app and enter:

java -version

You’ll most likely see the following:

java version "1.5.0_24"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_24-b02-357-9M3165)
Java HotSpot(TM) Client VM (build 1.5.0_24-149, mixed mode, sharing)

Obviously this is the wrong Java version since Netbeans is asking for Java 6 (aka Java 1.6).

Step 2. Get Java 1.6

However if you head over to Oracle you’ll find downloads for Linux and Windows but none for Mac. Why has the mighty Oracle deemed you unworthy of the latest Java?

Because you already have it! Your Mac is just not setup to use it.

Go Back to the Terminal and enter the following:

cd /System/Library/Frameworks/JavaVM.framework/Versions; ls;

You’ll get a list of all the Java versions available.

1.3		1.4		1.4.2		1.5.0		1.6.0		Current
1.3.1		1.4.1		1.5		1.6		A		CurrentJDK

Step 3. Configure Netbeans

The hint to get Netbeans working is in the error message; “or use –jdkhome switch to point to its installation directory”.

In the Finder browse to the NetBeans 6.9.app (in Applications/NetBeans/). Apps on OS X are really just packages so you can explore and edit their contents. Right-click (or control-click) on the app and select ‘Show Package Contents’ this will open a new Finder window. Then browse to Contents/Resources/NetBeans/etc and open ‘netbeans.conf’ in a text editor. Uncomment (remove the pound sign from) the line that starts with ‘#netbeans_jdkhome’ and set it to point to your Java 1.6 home as below:

netbeans_jdkhome="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home"

Save the file.

That’s it!

Try launching the NetBeans 6.9 app again, it should now work.

65 Comments

  1. Kate
    Posted July 18, 2010 at 11:20 am | Permalink

    Thanks! This helped a bunch!

  2. Niall
    Posted July 22, 2010 at 5:46 am | Permalink

    Fantastic! Took me an embarrassingly long time to find this. Netbeans is fantastic though, been using it at work and now can use it at home.

  3. Carmine
    Posted July 23, 2010 at 2:30 am | Permalink

    You deserve a statue! :-)

  4. Posted July 24, 2010 at 3:35 pm | Permalink

    YOU ROCK!!!

  5. ben
    Posted July 25, 2010 at 8:15 am | Permalink

    Many thanks! This guide was very helpful!

  6. Posted July 26, 2010 at 9:15 am | Permalink

    Thank You!!! I was afraid I wouldn’t get netbeans to work after 30 minutes of searching but then I found this… saved my day.

  7. Nestor
    Posted August 3, 2010 at 10:35 am | Permalink

    Hello, I’m very excited because this has solved my problem, and now I could use this awesome program. Thanks a lotttttttttt

  8. Rick
    Posted August 5, 2010 at 10:55 am | Permalink

    Thanks! That did the trick!

  9. Posted August 6, 2010 at 6:49 pm | Permalink

    Fantastic, thank you much! I was starting to get stressed out when I kept getting that error message, you saved the day!

  10. Randy Hill
    Posted August 7, 2010 at 11:47 am | Permalink

    Doesn’t work for me. I have 1.6.0_20 and netbeans 6.9.1, running latest Snow Leopard (10.6.4). It bounces in the dock a few times at launch, then quits without error message, even after updating the conf file.

  11. Bryan
    Posted August 7, 2010 at 3:27 pm | Permalink

    Thank You very much for this, you have helped a lot of people, god bless you and thanks again you are a god.

  12. Posted August 10, 2010 at 2:42 am | Permalink

    Thanks. You save my day.

  13. whatever
    Posted August 15, 2010 at 3:09 pm | Permalink

    Thank you very much, I tried installing openjdk6 and fixing alot, worked with this for 2 days before I found your solution :)

    Thanks a bunch

  14. Marco
    Posted August 18, 2010 at 5:13 pm | Permalink

    Grazie. La tua guida è stata molto utile.

  15. Gilberto Leon
    Posted August 25, 2010 at 12:20 pm | Permalink

    Follow the instructions and now Netbeans is up and running… thanks a lot…

  16. GAVVVR
    Posted August 26, 2010 at 12:47 pm | Permalink

    thanks a lot

  17. Rodrigo
    Posted August 28, 2010 at 7:27 pm | Permalink

    I spent a lot of time trying to get it work. thank you :D !

  18. handsofaten
    Posted September 1, 2010 at 9:00 am | Permalink

    Thanks!

  19. Nico
    Posted September 2, 2010 at 5:33 pm | Permalink

    There’s a simpler way to do this :
    http://technotes.steudel.org/2010/06/installing-netbeans-6-9-on-mac-osx-10-5-x/

  20. kie314
    Posted September 4, 2010 at 2:07 am | Permalink

    Great! Thanks!

  21. Marni
    Posted September 8, 2010 at 4:27 am | Permalink

    Thanks a lot! I heard a lot of good stuff about Netbeans, and i got this error, this helped a lot

  22. Posted September 8, 2010 at 8:26 pm | Permalink

    Hi, I had the same problem with Netbeans 6.9.1 on OS X 10.5.8, but solved in a different way.

    Doing it as your instructions, i would be manually setting NetBeans to always use the Java version that is in the specified directory. On a new java release, we would need to do this procedure again, changing directory. That wouldn’t be so good, I would forget doing that, for sure!

    So… I did a little research and found this: http://li-ma.blogspot.com/2009/01/change-default-java-version-on-mac.html . It teaches how to change your Mac’s default java version. On next updates, it’s easier (at least for me).

    I did that procedure, and NetBeans works great.

    Best regards.

  23. AJ
    Posted September 10, 2010 at 2:01 pm | Permalink

    Thanks a million!

  24. Posted September 13, 2010 at 8:29 am | Permalink

    THANKS A LOT!

  25. Gabriel
    Posted September 27, 2010 at 1:25 pm | Permalink

    Thanks a lot saved the day =]

  26. Jennie
    Posted September 28, 2010 at 2:13 pm | Permalink

    Thanks a mill this sorted it straight out :-)
    Thanks so much

  27. Posted October 7, 2010 at 8:45 pm | Permalink

    Oh wow thank you so much,
    this was a very straight forward instruction hahaha
    You really do deserve a statue, time to get on my PHP coding

  28. Rob
    Posted October 9, 2010 at 9:31 am | Permalink

    Thanks! You saved me a TON of frustration!

  29. rafal
    Posted October 20, 2010 at 2:23 am | Permalink

    Thanks ;) , helped :D

  30. Kyapo
    Posted October 25, 2010 at 11:13 pm | Permalink

    I love you! No, seriously, like I love someone who just saved me a world of frustration. That kind of love. Ok, maybe it’s just admiration [goes away to think about it].

  31. prescolt
    Posted October 28, 2010 at 11:31 am | Permalink

    thank it worked :)

  32. Peter
    Posted October 31, 2010 at 10:40 am | Permalink

    It works perfectly for me. Thanks.

    I am on 10.5.8, using Netbeans 6.9.1

  33. danny
    Posted November 20, 2010 at 10:43 am | Permalink

    thanks u so much…!!1 hha…

  34. Rodrigo
    Posted November 21, 2010 at 6:39 pm | Permalink

    I don’t know why! But my keyboard don’t work on NetBeans 6.9.1 when I do those steps… Anyone have a idea, about it?!

  35. adfs
    Posted November 23, 2010 at 8:05 am | Permalink

    Kick ass!

  36. Rob
    Posted November 25, 2010 at 4:44 pm | Permalink

    Thanks so much! I nearly put my macbook through the TV whilst trying to get this to work.

  37. noura
    Posted November 27, 2010 at 9:26 am | Permalink

    Thank uuuuuuuu!! i have followed a bunch of people nothing seems to work until i found your trick!! :D

  38. said
    Posted December 2, 2010 at 9:59 am | Permalink

    thank you so much..

  39. michael antczak
    Posted December 14, 2010 at 8:27 pm | Permalink

    beautiful how programmers are so altruistic minded…many thanks

  40. dhyas
    Posted December 17, 2010 at 11:13 am | Permalink

    this helped me a lot! thanks!

  41. Posted December 19, 2010 at 1:53 am | Permalink

    Finally. That great description did the trick. Thanks a lot.

  42. Posted December 21, 2010 at 9:43 am | Permalink

    This rocked! It saved me so much time and angst. Thanks!

  43. Will
    Posted December 30, 2010 at 9:14 am | Permalink

    Wow, THANK YOU! This should definitely be on NetBeans FAQ page, don’t know why it isn’t…

  44. Posted January 6, 2011 at 10:58 pm | Permalink

    Thanks Alastair this worked perfect!

  45. Posted January 9, 2011 at 9:36 am | Permalink

    Just another quick thanks for documenting this so clearly. I was about to give up, but this quickly got it going. Thanks.

  46. Posted January 13, 2011 at 4:37 am | Permalink

    Thanks so much for this! It had me scratching my head to get this to work! Your example made it so easy.

  47. Peter
    Posted January 17, 2011 at 12:18 am | Permalink

    Thank you so much! Your instructions were amazingly clear and got the job done =)

  48. John Tapsfield
    Posted January 20, 2011 at 10:27 pm | Permalink

    You are awesome. About to go on holiday tomorrow with my new learn JAVA book. Booted it up. Didnt work. 2 google searches and a worthless Apple update and out of the search ether came your solution!

    Amazing! Have a great day/life/success.

    Have bookmarked your site. Thanks so much!

  49. heesung
    Posted January 21, 2011 at 7:47 am | Permalink

    thax!!!!!!

  50. Glyn
    Posted January 23, 2011 at 6:15 pm | Permalink

    Thanks — very useful

  51. padpach
    Posted January 31, 2011 at 9:21 pm | Permalink

    Gracias Amigo!!!

  52. Posted February 1, 2011 at 8:11 pm | Permalink

    problem solved.. really help a lot! no more worries..

    thank you very much..

  53. Posted February 1, 2011 at 8:57 pm | Permalink

    Oh my goodness, you saved my bacon. I applaud this page. Oh my goodness… now, to my homework.

  54. Jason
    Posted February 6, 2011 at 12:25 pm | Permalink

    Great post!!! This worked perfect. Thank you so much!!!

  55. Posted February 7, 2011 at 9:26 am | Permalink

    Hey, Thank you so much! It’s working…
    I was so worried about it.
    Thanks! :)

  56. keisha
    Posted February 11, 2011 at 10:21 am | Permalink

    thank you very much for this post… :D

  57. Posted February 12, 2011 at 4:11 am | Permalink

    Thanks very much. You is the most teacher.

  58. Jason
    Posted March 14, 2011 at 11:26 pm | Permalink

    you rock!

  59. Yut
    Posted March 16, 2011 at 12:20 am | Permalink

    Thank you very much, you are great !

  60. Antonio
    Posted March 23, 2011 at 4:52 am | Permalink

    Thank you very much for the help.

    But, as Rodrigo, I can’t type anything when I launch the Netbeans. I think it is because my (our) keyboard is in Spanish and I’ve been trying to change the Netbean’s keyboard setup, but I can’t find it. Any hint?

  61. Frank
    Posted March 28, 2011 at 3:34 pm | Permalink

    Thank you very much for making this available!

    :D

  62. Posted April 1, 2011 at 2:50 am | Permalink

    I fucking love you! lifesaver! thank you so much, that was actually *fun.*

  63. Andrew
    Posted April 1, 2011 at 9:52 pm | Permalink

    Legend :)

  64. Posted April 7, 2011 at 1:25 am | Permalink

    Thanks, very clear and quick.

  65. soni
    Posted June 21, 2011 at 4:25 pm | Permalink

    THAAANKKK YOUUUUUUU You’re the BEST!!! :)

Post a Comment

Your email is never shared. Required fields are marked *

*
*

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word