Jump to content

SI-03: How do I install JAVA ?


Recommended Posts

Browse: [About the FAQ Forum] [Table of Contents] [FAQs] [Contribute] [SI: Software Installation]

 

SI-03: How do I install JAVA ?

 

Go and download the Java RPM from Sun's Java Page. The most current version at the time of this writing is j2re1.4.1, and I will assume that you have the same version. So make changes where appropriate if you have a different version.

 

When you reach the page that lists all the downloads, choose the JRE Download for "Linux RPM in self-extracting file." Save this to your home directory somewhere. If you want to do Java developing, you can get the SDK version, which is nearly twice the size, and requires an extra couple of steps that I will outline below.

 

Now, from a console, you need to run this file like so: sh j2re-1_4_1_01-linux-i586-rpm.bin. Read the license and agree to it. After you accept the license, it will extract the RPM. (If you got the SDK, substitute the filename where appropriate.)

 

This will produce an output file called j2re-1_4_1_01-fcs-linux-i586.rpm, which you must now install. In the console, run su. Enter the password for root when it asks you for it. Now, run rpm -ivh j2re-1_4_1_01-fcs-linux-i586.rpm. The Sun JRE is now installed, but it is not the default for your system yet. We will fix this now. (If you got the SDK, substitute the filename where appropriate.)

 

In the same console, as the root user still, we must go and delete the old symlinks and replace them with new ones that point to the Sun Java binaries.

 

If you downloaded the J2RE, run the following sequence of commands:

 

cd /usr/bin
rm java javac jar
ln -s /usr/java/j2re1.4.1_01/bin/java java

 

If you downloaded the J2SDK, run the following sequence of commands:

 

cd /usr/bin
rm java javac jar
ln -s /usr/java/j2sdk1.4.1_01/bin/java java
ln -s /usr/java/j2sdk1.4.1_01/bin/javac javac
ln -s /usr/java/j2sdk1.4.1_01/bin/jar jar

 

Now, in order to be able to use Java in browsers, such as Mozilla, Galeon, and so forth, you must complete these additional steps:

 

cd /usr/lib/mozilla-1.4/plugins/

 

If you got the J2RE, use this command:

ln -s /usr/java/j2re1.4.1_01/plugin/i386/ns610/libjavaplugin_oji.so libjavaplugin_oji.so

 

If you got the J2SDK, use this command:

ln -s /usr/java/j2sdk1.4.1_01/jre/plugin/i386/ns610/libjavaplugin_oji.so libjavaplugin_oji.so

 

edit: additional information

On Linux, Mozilla requires JRE 1.4.2 or later.

 

Mozilla 1.4 and later, and Mozilla Firebird, are compiled with gcc 3.2.3. A gcc 3.x compatible version of the Java plugin must be used. JRE 1.4.2 contains a compatible plugin.

 

If you installed the JRE 1.4.2_01 RPM, this plugin is /usr/java/j2re1.4.2_01/plugin/i386/ns610-gcc32/libjavaplugin_oji.so - and to install it for Mozilla (including Mozilla Firebird), do the following:

  • Open a terminal
  • Change to your Mozilla (or Mozilla Firebird) plugins directory
  • Issue the following command: ln -s /usr/java/j2re1.4.2_01/plugin/i386/ns610-gcc32/libjavaplugin_oji.so

 

If you are using an older Linux distribution, you may need to install the gcc3 support libraries, as the gcc 3.2 version of the Java plugin requires libgcc_s.so.1 to operate. You may be able to find packages using Google.

 

If you are using an old or unofficial build of Mozilla (1.4a or later) or Mozilla Firebird, you can check which compiler was used by entering about:buildconfig in the location bar and pressing enter. You will see a line such as "gcc version 3.3 20030226 (prerelease) (SuSE Linux)", which will show the compiler that was used. If gcc2.9x was used, you need to use the ns610 plugin, not the ns610-gcc32 plugin.

 

Now you are done, and you can close the console. Try installing a Java program, such as LimeWire, and it should work just fine.

 

from MottS' original tutorial

4) Go HERE to see if Java is enabled. Notice that you may have to restart your browser or even restart X (press CTRL-ALT-BACKSPACE simultaneously) for it to work.

 

Have fun!

 

Information in this tutorial was originally written by DOlson and is used here with his permission. You can visit his web page, the Mandrake eXPerience here: http://pgshopping.com/mdkxp/

Edited by LiquidZoo
Link to comment
Share on other sites

 Share

×
×
  • Create New...