I've been in the world of software development for 14+ years working with most mainstream programming languages at some point. Chad is a DZone MVB and is not an employee of DZone and has posted 38 posts at DZone. You can read more from them at their website. View Full User Profile

Installing and Configuring NetBeans IDE 7.1.2 and the Java JDK 1.7 on OS X

  • submit to reddit

Recently Oracle released the JDK 1.7 for OS X (download here). This is a JDK release as of the time of this article and a consumer version of the JRE 1.7 will be released later in 2012. Today I’m going to walk through how you can install and configure the new JDK 1.7 on OS X as well as how to take advantage of it in NetBeans IDE 7.1.2.

If you have NetBeans IDE 7.1 already installed then make sure to run the update and get it running on version 7.1.2 or above.

Note: Oracle’s install docs are located here: http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html

You need to be running OS X Lion 10.7.2 or newer to install the new JDK 1.7.

Download the JDK 1.7 for OS X here. Once that is downloaded you double click the dmg file to begin walking through the guided installation process.

Once the installer finishes you will find the new JDK 1.7 located in the following folder: /Library/Java/JavaVirtualMachines/

Inside of that location you’ll see a file called 1.7.0.jdk. Double-click that file so you can set your preference to the JDK 1.7 on your system. Simply drag the JDK 1.7 to the top.

Once that is done go into the Terminal and run the following command:

$ java -version

You should now see the version coming back as Java 1.7 etc.

For NetBeans IDE 7.1.2 you need to go into the following menu item: Tools -> Java Platforms

A dialog will open allowing you to add another JDK version. Press the Add Platform button and another dialog will open. The new JDK should already be present in the next dialog so you just need to navigate down to: 1.7.0.jdk/contents/home and then press Next.

Step through the wizard and exit out of the dialog. JDK 1.7 should now be available to your Java projects.

To switch a NetBeans IDE project to the new JDK 1.7 make sure to right-click on the project in the Projects window. In the project properties dialog you can drill into the Build -> Compile option and then select the Java platform you want. Also note the Compile on Save option, set that as you need to.

Thats it, you should now be using the JDK 1.7 on OS X and NetBeans IDE. Kudos to Oracle for making this a very pleasant experience on OS X.


Published at DZone with permission of Chad Lung, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Andrzej Grzesik replied on Thu, 2012/05/24 - 1:29am

Fix your http server, pictures do not appear. Guess: block by referrer?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.