Updating to the sun java on 64 bit ubuntu

From $1

This page is a compendium of the steps required to update the jdk as culled from this excellent set of instructions from the coffee coke and code blog

Follow the instructions at the coffee and code blog to copy the jdk to the /usr/lib/jvm directory. The ubuntu script that modifies the *.jinfo file is quite finicky and I prefer modifying it manually in an editor ( sudo vi /usr/lib/jvm/.java-6-sun.jinfo) .  Most browsers as of Jan 2009 tend to be 32bit and/or require 32 bit plugins. To avoid confusion the sun jdk 64 bit  install does not provide these components. As specified by sun when you install the jvm 

 

There are no 64-bit versions of the Java Plugin, Java Web Start or Java Control Panel; however the 32-bit versions of the JRE can be installed on 64-bit systems in order to obtain this functionality. Note that only 32-bit browsers are supported at this time.

 

The  plugin and appletviewer pointed to by this *.jinfo  can be installed as indicated on the ubuntuforums thread or enabled manually if a previous installation already exists and the link to those can be updated in this file. Instructions on enabling these features are available here

Ubuntu puts its jvms in the /usr/lib/jvm directory. The exact java virtual machine used can be setup manually by a modification of two files.

1) The directory /usr/lib/jvm has a .java-6-sun.jinfo  file that ubuntu uses to inform itself of various attributes of the java platform.

Look at this file /usr/lib/jvm/.java-6-sun.jinfo and modify it to tell ubuntu where the jvm is located. Specifically looking at the name and alias . Set those to point to the directory with the java development kit ( which includes ther runtime and jre)

In my case I have name=java-6-sun-1.6.0.11
alias=java-6-sun
priority=63http://mapskp.cesr.fr/tools/javaplugin/java_plugin_test.php
section=non-free

jre java /usr/lib/jvm/java-6-sun/jre/bin/java
jre keytool /usr/lib/jvm/java-6-sun/jre/bin/keytool
jre pack200 /usr/lib/jvm/java-6-sun/jre/bin/pack200
jre policytool /usr/lib/jvm/java-6-sun/jre/bin/policytool
jre rmid /usr/lib/jvm/java-6-sun/jre/bin/rmid
jre rmiregistry /usr/lib/jvm/java-6-sun/jre/bin/rmiregistry
jre unpack200 /usr/lib/jvm/java-6-sun/jre/bin/unpack200
jre orbd /usr/lib/jvm/java-6-sun/jre/bin/orbd
jre servertool /usr/lib/jvm/java-6-sun/jre/bin/servertool
jre tnameserv /usr/lib/jvm/java-6-sun/jre/bin/tnameserv
jre jexec /usr/lib/jvm/java-6-sun/jre/lib/jexec
jdk appletviewer /usr/lib/jvm/java-6-sun/bin/appletviewer
jdk apt /usr/lib/jvm/java-6-sun/bin/apt
jdk extcheck /usr/lib/jvm/java-6-sun/bin/extcheck
jdk idlj /usr/lib/jvm/java-6-sun/bin/idlj
jdk jar /usr/lib/jvm/java-6-sun/bin/jar
jdk jarsigner /usr/lib/jvm/java-6-sun/bin/jarsigner
jdk javac /usr/lib/jvm/java-6-sun/bin/javac
jdk javadoc /usr/lib/jvm/java-6-sun/bin/javadoc
jdk javah /usr/lib/jvm/java-6-sun/bin/javah
jdk javap /usr/lib/jvm/java-6-sun/bin/javap
jdk jconsole /usr/lib/jvm/java-6-sun/bin/jconsole
jdk jdb /usr/lib/jvm/java-6-sun/bin/jdb
jdk jhat /usr/lib/jvm/java-6-sun/bin/jhat
jdk jinfo /usr/lib/jvm/java-6-sun/bin/jinfo
jdk jmap /usr/lib/jvm/java-6-sun/bin/jmap
jdk jps /usr/lib/jvm/java-6-sun/bin/jps
jdk jrunscript /usr/lib/jvm/java-6-sun/bin/jrunscript
jdk jsadebugd /usr/lib/jvm/java-6-sun/bin/jsadebugd
jdk jstack /usr/lib/jvm/java-6-sun/bin/jstack
jdk jstat /usr/lib/jvm/java-6-sun/bin/jstat
jdk jstatd /usr/lib/jvm/java-6-sun/bin/jstatd
jdk jvisualvm /usr/lib/jvm/java-6-sun/bin/jvisualvm
jdk native2ascii /usr/lib/jvm/java-6-sun/bin/native2ascii
jdk rmic /usr/lib/jvm/java-6-sun/bin/rmic
jdk schemagen /usr/lib/jvm/java-6-sun/bin/schemagen
jdk serialver /usr/lib/jvm/java-6-sun/bin/serialver
jdk wsgen /usr/lib/jvm/java-6-sun/bin/wsgen
 

2) The alias in the section above mentions the symlink as having a name java-6-sun , accordingly I have a symlink called java-6-sun pointing to the directory where the jvm is located

harijay@mymachine:/usr/lib/jvm$ ls -latr
total 96
drwxr-xr-x 192 root root 73728 2009-01-10 12:17 ..
drwxr-xr-x   9 root root  4096 2009-01-11 23:07 java-6-sun-1.6.0.07
drwxr-xr-x  10 root root  4096 2009-01-15 10:51 java-6-sun-1.6.0.11
-rw-r--r--   1 root root  2679 2009-01-15 10:52 .java-6-sun.jinfo
-rw-r--r--   1 hari hari  1159 2009-01-15 10:58 create-jvm-alternative-6.10.pl
lrwxrwxrwx   1 root root    32 2009-01-15 11:03 java-6-sun -> /usr/lib/jvm/java-6-sun-1.6.0.11
drwxr-xr-x   4 root root  4096 2009-01-15 11:03 .
 

And if everything went correctly you will have the correct java version, which can be tested by

harijay@mymachine:~$ java -version
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b16, mixed mode)

 Java 32bit plugin install for a 64 bit system

The best method that is an alternative to the symlinking method as described by sun is to get the openjdk web plugin .( OR see below for the 64 bit plugin)

Visit this site and surrender youself to it. It will install the iced-tea javav plugin and hopefully not break everything else .

 

The Java 64 bit plugin install for a Ubuntu 64 bit system

Since Java 6 update 10 , Sun provides a 64 bit plugin for 64 bit browsers on Ubuntu Hardy Heron and upwards.
 

The plugin support for 64 bit however reached maturity with Java 6 update 12 . To install the plugin install java 6 update 12 as given above. To get the plugin to work . symlink the file libnpjp2.so to your home plugins folder as shown below. I f the /home/youirusername/.mozilla/plugins directory does not exist create it . Then symlink the file

ln -s /usr/lib/jvm/java-6-sun-1.6.0.12/jre/lib/amd64/libnpjp2.so   /home/hari/.mozilla/plugins/.

I have Firefox which is 64 bit on my 8.04 Hardy heron box and the plugin works great! . There is no need to use the 32 bit plugin as mentioned above

Tags:
 
Images (0)
 
Comments (0)
You must login to post a comment.