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.

15 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. Marco
    Posted August 18, 2010 at 5:13 pm | Permalink

    Grazie. La tua guida รจ stata molto utile.

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

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

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

    thanks a lot

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