Howto: Java 7(ea) & Eclipse 3.7.1 on Mac OS X

by

I recall that when Java 6 first came out, Mac OS X did not support it at first and it was only when Java 6 got full support by Apple that I decided to switch to a Mac. Now, years later Java 7 is out on Windows/Linux/etc and I have been feeling a bit cheated by Apple since they won’t provide Java 7 and have in fact decided to drop Java support in OS X in the future.

Happily, the OpenJdk project does have Java 7 for Mac OSX under development with an official build from Oracle available here.

In related news, Eclipse Indigo SR1 (v3.7.1) has just been released with full JDK1.7 support for Mac OS X. It is available here.

To get Eclipse 3.7.1 to work with Java 1.7 (EA) on Mac OS X do the following.

1) Install Java 7 but leave the more complete+stable Java 6 as the default Java on Mac OS X.

2) Install Eclipse and let it run under Java 6.

3) Start Eclipse, select Preferences,  Installed JREs, Execution Environments and click on “add”.

4) Select standard VM.

5) In the field JRE home, do not attempt to browse for the Java 7 directory as this will not work. Instead just paste the installation dir of the installed Java 7 package +/Content/Home (fx. “/Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home”) into the JRE home text field and press return.

6) Fix the JRE name in the field below to something suitable like “JDK1.7″ and click finish.

Now you should be able to create your Java 7 project in eclipse on your Mac OS X and you should be able to run/debug without problems…. Yes!

About these ads

5 Responses to “Howto: Java 7(ea) & Eclipse 3.7.1 on Mac OS X”

  1. Stu Thompson (@stuinzuri) Says:

    I had to rename the JDK 1.7 file to a name without spaces. No matter how I worked the path otherwise, quotes or not, Eclipse would not recognize the directory.

  2. Mike Says:

    Thank you so much! I’m just starting to pick Java back up and had used Eclipse on Windows but have since moved to a Mac. I wasn’t relishing the prospects of either using an older version of Java, learning a new IDE, or dealing with text editors and command lines. This tip was exactly what I needed and all is well again.

  3. dajoyce13 Says:

    Awesome… your tip works with the Oracle Java SE 7u4 for OS X

  4. Dmitry Says:

    Thx! It helped a lot.

  5. altumano (@altumano) Says:

    Thanks, exactly what I needed !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: