Difference between revisions of "Java Run-time Environment for the MAC OS"

From ARL Wiki
Jump to navigationJump to search
(New page: Category: The SPP Category: The SPP Tutorial There is one annoyance: <blockquote> Even after you install Java 1.6 for the MAC OS, the new JRE (runtime system) will NOT be the d...)
 
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
[[Category:  The SPP Tutorial]]
 
[[Category:  The SPP Tutorial]]
  
There is one annoyance:
+
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.
 
 
<blockquote>
 
Even after you install Java 1.6 for the MAC OS, the new JRE (runtime system) will NOT be the default.
 
 
         <blockquote>
 
         <blockquote>
           If you type in ''java -version'', it will say respond
+
           If you type in ''java -version'', it will respond
           with the old version number.
+
           with the old version number, not the one you just installed.
 
           And if you look for more updates, it will say that you
 
           And if you look for more updates, it will say that you
 
           are already up-to-date.
 
           are already up-to-date.
 
         </blockquote>
 
         </blockquote>
</blockquote>
 
  
 
And to be doubly annoying, what you need to do depends on whether you
 
And to be doubly annoying, what you need to do depends on whether you
Line 29: Line 25:
 
* ''Install Apple's update for Java 1.6''
 
* ''Install Apple's update for Java 1.6''
 
         <blockquote>
 
         <blockquote>
           See [http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_2
+
           See http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_2.
          http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_2].
 
 
         </blockquote>
 
         </blockquote>
 
* ''Replace the java file (usually /usr/bin/java) with a symbolic link to the correct location''
 
* ''Replace the java file (usually /usr/bin/java) with a symbolic link to the correct location''
Line 37: Line 32:
 
           (assuming ''java'' is located at /usr/bin/java):
 
           (assuming ''java'' is located at /usr/bin/java):
 
<pre>
 
<pre>
which java              # find the location of the java command
+
    which java              # find the location of the java command
cd /usr/bin            # assumes that java is at /usr/bin/java
+
    cd /usr/bin            # assumes that java is at /usr/bin/java
sudo mv java java.old  # rename the current java
+
    sudo mv java java.old  # rename the current java
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java
+
    sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java
                        # create a symbolic link to the new java
+
                            # create a symbolic link to the new java
 
</pre>
 
</pre>
 +
        </blockquote>
 +
        <blockquote>
 
         Now, if you repeat the first step above, you should see
 
         Now, if you repeat the first step above, you should see
 
         that the java is version now 1.6.
 
         that the java is version now 1.6.
Line 52: Line 49:
  
 
If you want to know more about this, try the link
 
If you want to know more about this, try the link
[http://blogs.sun.com/cmar/entry/java_1_6_finally_available http://blogs.sun.com/cmar/entry/java_1_6_finally_available].
+
http://blogs.sun.com/cmar/entry/java_1_6_finally_available.
 
 
  
 
== 32-bit MAC ==
 
== 32-bit MAC ==
  
 
Java 1.6 is not available for 32-bit MACs from Sun.
 
Java 1.6 is not available for 32-bit MACs from Sun.
So, you need to use ''Soylatte'' which based on the BSD port of Sun's Java 6 JDK.
+
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''
 
* ''Verify that the problem really is the one described above''
Line 67: Line 63:
 
         </blockquote>
 
         </blockquote>
 
* ''Download what you need from Soylatte by following the download link''
 
* ''Download what you need from Soylatte by following the download link''
        </li>
 
 
         <blockquote>
 
         <blockquote>
           See [http://landonf.bikemonkey.org/static/soylatte/ http://landonf.bikemonkey.org/static/soylatte/].
+
           See http://landonf.bikemonkey.org/static/soylatte/.
 
         </blockquote>
 
         </blockquote>
 
* After installing, if you get the error message
 
* After installing, if you get the error message
         "''Exception in thread main java.lang.InternalError: Can't connect
+
         <blockquote>
 +
        ''Exception in thread main java.lang.InternalError: Can't connect
 
         to X11 window server using ':0.0' as the value of the DISPLAY
 
         to X11 window server using ':0.0' as the value of the DISPLAY
         variable.''", you need to set the DISPLAY environment variable
+
         variable.''
        like this:
+
        </blockquote>
 +
        <ul>
 +
        you need to set the DISPLAY environment variable like this:
 
<pre>
 
<pre>
 
         export DISPLAY=:0.0:
 
         export DISPLAY=:0.0:
 
</pre>
 
</pre>
 +
        </ul>

Latest revision as of 20:43, 25 February 2010


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: