
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
Thanks! This helped a bunch!
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.
You deserve a statue!
YOU ROCK!!!
Many thanks! This guide was very helpful!
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.
Hello, I’m very excited because this has solved my problem, and now I could use this awesome program. Thanks a lotttttttttt
Thanks! That did the trick!
Fantastic, thank you much! I was starting to get stressed out when I kept getting that error message, you saved the day!
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.
Thank You very much for this, you have helped a lot of people, god bless you and thanks again you are a god.
Thanks. You save my day.
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
Grazie. La tua guida è stata molto utile.
Follow the instructions and now Netbeans is up and running… thanks a lot…
thanks a lot
I spent a lot of time trying to get it work. thank you
!
Thanks!
There’s a simpler way to do this :
http://technotes.steudel.org/2010/06/installing-netbeans-6-9-on-mac-osx-10-5-x/
Great! Thanks!
Thanks a lot! I heard a lot of good stuff about Netbeans, and i got this error, this helped a lot
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.
Thanks a million!
THANKS A LOT!
Thanks a lot saved the day =]
Thanks a mill this sorted it straight out
Thanks so much
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
Thanks! You saved me a TON of frustration!
Thanks
, helped
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].
thank it worked
It works perfectly for me. Thanks.
I am on 10.5.8, using Netbeans 6.9.1
thanks u so much…!!1 hha…
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?!
Kick ass!
Thanks so much! I nearly put my macbook through the TV whilst trying to get this to work.
Thank uuuuuuuu!! i have followed a bunch of people nothing seems to work until i found your trick!!
thank you so much..
beautiful how programmers are so altruistic minded…many thanks
this helped me a lot! thanks!
Finally. That great description did the trick. Thanks a lot.
This rocked! It saved me so much time and angst. Thanks!
Wow, THANK YOU! This should definitely be on NetBeans FAQ page, don’t know why it isn’t…
Thanks Alastair this worked perfect!
Just another quick thanks for documenting this so clearly. I was about to give up, but this quickly got it going. Thanks.
Thanks so much for this! It had me scratching my head to get this to work! Your example made it so easy.
Thank you so much! Your instructions were amazingly clear and got the job done =)
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!
thax!!!!!!
Thanks — very useful
Gracias Amigo!!!
problem solved.. really help a lot! no more worries..
thank you very much..
Oh my goodness, you saved my bacon. I applaud this page. Oh my goodness… now, to my homework.
Great post!!! This worked perfect. Thank you so much!!!
Hey, Thank you so much! It’s working…
I was so worried about it.
Thanks!
thank you very much for this post…
Thanks very much. You is the most teacher.
you rock!
Thank you very much, you are great !
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?
Thank you very much for making this available!
I fucking love you! lifesaver! thank you so much, that was actually *fun.*
Legend
Thanks, very clear and quick.
THAAANKKK YOUUUUUUU You’re the BEST!!!