
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.
15 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.
Grazie. La tua guida รจ stata molto utile.
Follow the instructions and now Netbeans is up and running… thanks a lot…
thanks a lot