We are all aware that the next version of Java is about to make its flashy entrance this July; We’ve seen the list of features it brings to the table and we are nothing less than anxious to take the JDK for a “test drive”. So why not do just that?

Even though the current build (127 at the time this post was written) is available for download, we must take into account that it is still under development, so don’t expect the binaries you download now to provide the same functionality and stability as the stable release which we will get to see in summer. However, you have an opportunity to get an early impression of how the new Java version will behave at your fingertips and you should definitely take advantage of it. Moreover, if you want to track the progress of the various projects composing JDK 7, you may want to subscribe to their mailing lists.

On January 13th 2011, Mark Reinhold – chief architect of the Java Platform Group at Oracle – announced on the jdk7-dev mailing list: “The JDK 7 Project has reached a major milestone: It is Feature-Complete. This means that all of the planned features have been implemented and integrated into the master forest, along with their unit tests, and all other planned tests have been written and run on a representative set of platforms”.

Without further ado, below is a step-by-step detailed description of downloading and setting up the latest JDK 7 build (for Debian/Windows/MacOS X) on your machine.

Debian

1. Download binaries from http://download.java.net/openjdk/jdk7/

Alternatively, open a terminal and type:

  • for 32 bit OS:
    wget http://www.java.net/download/jdk7/archive/b125/binaries/jdk-7-ea-bin-b125-linux-i586-13_jan_2011.bin
  • for 64 bit OS:
    wget http://www.java.net/download/jdk7/archive/b125/binaries/jdk-7-ea-bin-b125-linux-x64-13_jan_2011.bin

2. Run the previously downloaded self-extracting .bin file (first make sure you have executing permissions by chmodding those files to have +x access), by typing in the command line:

  • for 32 bit OS
    ./jdk-7-ea-bin-b125-linux-i586-13_jan_2011.bin
  • for 64 bit OS
    ./jdk-7-ea-bin-b125-linux-x64-13_jan_2011.bin

Accept the license agreement by writing “yes” in the command line and the JDK 7 will unpack itself in the same folder as the .bin file . You are required to press “enter” to finish unpacking.

3. Move the newly unpacked jdk1.7.0 folder to the /opt/jvm/ folder – creating /opt/jvm folder first:

sudo mkdir /opt/jvm ; sudo mv jdk1.7.0 /opt/jvm

If you have more than one JDK’s installed, type:

sudo update-alternatives –-config java.

This will get you a list of the installed JDK’s and their indexes. To install JDK 7 you just type:

sudo update-alternatives –-install /usr/bin/java java /opt/jvm/jdk1.7.0/jre/bin/java 2

where 2 is the next unused index from the previous command.  This should be repeated for javac and javadoc if you are going to use them via the command line. Finally check that the proper Java is installed by typing:

java -version

Windows

  1. Download binaries from: http://dlc.sun.com.edgesuite.net/jdk7/binaries/index.html
  2. Run the downloaded .exe file and go through the installation wizard, we recommend installing it to “C:\Java\jdk1.7.0_build<x>”
  3. Set JAVA_HOME & PATH environment variables: In the command line write:set JAVA_HOME=”C:\Java\jdk1.7.0″
    set PATH=C:\Java\jdk1.7.0\bin;%PATH%

NOTE: GUIs for setting path variables can be found here:

4. [OPTIONAL]run java -version & javac -version to check that they point to the correct jdk version

MacOS X

On 12 January 2011, Richard Mayhew wrote an article on The Server Side about the MacOS and JDK 7 tandem. He stated the following: “Just in case you didn’t know: wikis.sun.com has directions for building OpenJDK7 for MacOS. Also, code.google.com has a prebuilt JDK7 for 32-bit and 64-bit MacOS.” Following the links provided in this article you will be able to set up JDK 7 on your Mac OS.

You are now ready to start juggling with the new features which JDK 7 has to offer. You may test your code in your favourite text editor, or perhaps you wish to try Netbeans 7.0 Beta IDE which introduces language support for development to the Java SE 7 specification with the JDK 7 platform.

Enjoy!  Dragos (our fantastic intern!), John, Ben & Martijn

Did you like this? Share it: