Java Run-time Environment for the MAC OS

From ARL Wiki
Revision as of 20:43, 25 February 2010 by Ken Wong (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


There is one annoyance for MAC OS users: Even after you install Java 1.6, the new JRE (runtime system) will NOT be the default.

If you type in java -version, it will respond with the old version number, not the one you just installed. And if you look for more updates, it will say that you are already up-to-date.

And to be doubly annoying, what you need to do depends on whether you have a 32-bit MAC or a 64-bit one.

64-bit MAC

So, this is what you need to do if you have a 64-bit MAC:

  • Verify that the problem really is the one described above

Enter the command java -version. If the version number is some form of 1.6, the problem might not be what is described above.

  • Install Apple's update for Java 1.6

See http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_2.

  • Replace the java file (usually /usr/bin/java) with a symbolic link to the correct location

Here is what most MAC OS users did at the command line (assuming java is located at /usr/bin/java):

    which java              # find the location of the java command
    cd /usr/bin             # assumes that java is at /usr/bin/java
    sudo mv java java.old   # rename the current java
    sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java
                            # create a symbolic link to the new java

Now, if you repeat the first step above, you should see that the java is version now 1.6. (Note that you have to use the sudo command twice because those operations require more than ordinary priviledges.) If you find a better way to do this, send us email at testbed-ops AT arl.wustl.edu.

If you want to know more about this, try the link http://blogs.sun.com/cmar/entry/java_1_6_finally_available.

32-bit MAC

Java 1.6 is not available for 32-bit MACs from Sun. So, you need to use Soylatte which is based on the BSD port of Sun's Java 6 JDK.

  • Verify that the problem really is the one described above

Enter the command java -version. If the version number is some form of 1.6, the problem might not be what is described above.

  • Download what you need from Soylatte by following the download link

See http://landonf.bikemonkey.org/static/soylatte/.

  • After installing, if you get the error message

Exception in thread main java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

    you need to set the DISPLAY environment variable like this:
            export DISPLAY=:0.0: