Here is how to install Java using Sun's Java RPM:
- Go to the Java Runtime Download Page.
- Click on "Download J2SE JRE."
If you want to develop Java software, get the SDK package instead of the JRE, and alter the rest of these directions appropriately. You'll have to set export JDK_HOME="$JAVA_HOME" in the java.sh below, as well.
- Choose "Accept" and click "Continue."
- Click on the link that says "Linux RPM in self-extracting file."
- Save the file in your home directory. The download will take a little while.
- Open a Terminal.
- Become root:
- To install the rpm, type:
rpm -Uvh j2re-*.rpm
There will be a bit of whirring.
- Create a file called java.sh in /etc/profile.d/
The easiest way to do this is:
If you're not in a graphical environment:
- This file should contain the following lines.
You have to modify the first line appropriately, according to what's actually in /usr/java/:
- To finish it up, do:
chmod +x /etc/profile.d/java.sh
Java should now work properly. You will need to log in and log out for some things to function properly.
To install the browser plugin for java, as root, do:
ln -sf /usr/java/<YourJavaDirectory>/plugin/i386/ns610-gcc32/libjavaplugin_oji.so /usr/lib/mozilla/plugins
Replace <YourJavaDirectory> with the name of the actual directory.
If that doesn't work, try this as the user you are logged in as (not root):
ln -sf /usr/java/<YourJavaDirectory>/plugin/i386/ns610-gcc32/libjavaplugin_oji.so ~/.mozilla/plugins/
(Thanks to Matt Labrum for that suggestion.)
For the SDK, the plugin is:
(Thanks to Rob Hoeft for that.)
(Thanks to Andre Robatino and "m d" for suggesting the /usr/lib/mozilla/ directory instead of the version-specific one. Thanks to Kai Thomsen for noting that you only have to login-logout, not reboot. Thanks to Cymon Cox for the heads-up that Sun's site changed.)