I used to have Sun's J2SE environment under the Redhat version of Linux. Shortly after migrating to Debian, I had investigated the installation of Java. However, it seemed that the Debian had licensing problems with Sun's Java platform, so I didn't pursue it further.
Later, the absence of JVM support in Mozilla was making it a little difficult to check that my web-site's applets were working. I therefore re-opened the investigation into Java support on Debian. With a little more time to spend I read further into the Debian Java FAQ. I discovered that this FAQ contains a very useful description of how to get the Sun J2SE environment working under Debian (and specifically of interest to me, Debian Testing). What follows is therefore more-or-less a duplication of the relevant sections of the FAQ, supplemented by content from a page submitted by Brandon Phillips on Open Source Lab's wiki, documentation and knowledge site, which was placed here for my handy reference (but now, in 2016, no longer exists).
Here's the steps the install Sun J2SE on Debian Testing:
/var/install/java
). At the time of writing,
the latest version is 1.4.2_04. The J2SE installer is run as
a shell script, so you can run it by:
cd /var/install/java sh ./j2sdk-1_4_2_04-linux-i586.binThis will create a new directory
j2sdk-1_4_2_04
under
the /var/install/java
directory.
j2sdk-1_4_2_04
directory to
/usr/local/lib
and create a link. (You need to be
root to do this).
mv /var/install/java/j2sdk-1_4_2_04 /usr/local/lib ln -s /usr/local/lib/j2sdk-1_4_2_04 /usr/local/lib/jdk chown -R root:src /usr/local/lib/jdk # necessary?The creation of the link is not necessary, but it means you can refer to
/usr/local/lib/jdk
always, and still
continue to upgrade to new versions.
apt-get install kaffe equivs java-common java2-commonThis step will cause the installation of the kaffe Java platform, the Debian default.
mkdir -p /var/install/java/pkg cd /var/install/java/pkg cp /usr/share/doc/java-common/dummy-packages/*.control . equivs-build java-compiler-dummy.control equivs-build java-virtual-machine-dummy.control equivs-build java1-runtime-dummy.control equivs-build java2-compiler-dummy.control equivs-build java2-runtime-dummy.controlYou should now have five packages in
/var/install/java/pkg
that should be installed.
dpkg -i java-compiler-dummy_1.0_all.deb dpkg -i java-virtual-machine-dummy_1.0_all.deb dpkg -i java1-runtime-dummy_1.0_all.deb dpkg -i java2-compiler-dummy_1.0_all.deb dpkg -i java2-runtime-dummy_1.0_all.deb
update-alternatives
technique is used to determine
which binaries should be invoked.
update-alternatives --install /usr/bin/javac javac \ /usr/local/lib/jdk/bin/javac 500 update-alternatives --install /usr/bin/java java \ /usr/local/sun/jdk1.X/bin/java 500 update-alternatives --install /usr/bin/appletviewer appletviewer \ /usr/local/lib/jdk/bin/appletviewer 500These command set up the Sun binaries for javac, java and the appletviewer. The use of the priority, 500, will ensure that Sun binaries are used in preference to the kaffe binaries installed as part of step 3.
java
as root to allow the system preference
directories to be set up, and to check that the right version of java
is invoked.
java -version
ln -s \ /usr/local/lib/jdk/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so \ /usr/lib/mozilla/plugins/libjavaplugin_oji.so