Sun Java Installation
Some people are intimidated by the Jpackage installation process, for those people here is a "down and dirty" intallation without having to rebuild any packages. Steps 1 - 8 cover the basic plugin for Mozilla and Firefox. Steps 9 - 20 cover the requirements for programs that require Java, such as Limewire.
Applicable to Fedora Versions
- Fedora 10+
- For x86_64 please use http://fedoraforum.org/forum/showthread.php?t=194858
Requirements
- Fedora x86 Installation
- Mozilla x86 Installed or Firefox x86 Installed
- For F8: Remove java-1.7.0-icedtea and java-1.7.0-icedtea-plugin
- For F9 and F10: Remove java-1.6.0-openjdk and java-1.6.0-openjdk-plugin
- Install compat-libstdc++-33, These compatability libraries are requried with java 1.6+
- Install compat-libstdc++-296, These compatibility libraries are requried with java 1.6+
- Open a terminal .
-
Login as root by entering the following.
su --login
- At the password prompt enter the password for root.
- This step is only to be executed if you are running Fedora 8: Remove java-1.7.0-icedtea and java-1.7.0-icedtea-plugin.
yum remove java-1.7.0-icedtea java-1.7.0-icedtea-plugin
- This step is only to be executed if you are running Fedora 9 or Fedora 10: Remove java-1.6.0-openjdk and java-1.6.0-openjdk-plugin.
yum remove java-1.6.0-openjdk java-1.6.0-openjdk-plugin
- Install the compatiablility libraries by performing the following:
yum install compat-libstdc++-33 compat-libstdc++-296
- After the libraries are installed perform the following:
/sbin/ldconfig
- Ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib). The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and filenames of
the libraries it encounters when determining which versions should have their linksupdated. Note that on a successful execution the command will give no output.
- Once these steps are completed perform the steps listed in the Doing the Work Section
Doing the work
-
Download the latest version of the JRE bin here. (http://java.sun.com/javase/downloads/index.jsp ).
(the .bin file NOT the rpm.bin). At this time the current version is "JRE 6 Update 18".
-
Select the Download button next to your selection.
-
Choose "Linux" from the Platform dropdown. Click on the checkbox to agree to the license agreement, then click on "Continue".
- On the Download screen choose the desired .bin (NOT .rpm.bin) file and download it by clicking on the file name.
- Open a terminal .
-
Login as root by entering the following.
su --login
-
Now change to the directory /opt.
cd /opt
- At the password prompt enter the password for root.
-
Execute the binary installation for JRE in the /opt directory (ensure that you use the path to the downloaded file i.e. /home/user/Downloads).
sh /home/$youruser/Download/jre-6u18-linux-i586.bin
After executing this command you will need to read through the License Agreement and type yes for the installer to actually start installing the software. Once installed it will create a folder "jre1.6.0_18" in the /opt directory.
-
Now to install the plug-in execute the following command.
ln -s /opt/jre1.6.0_18/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so
-
Create a java.sh script by entering the following, ensure you press enter after each line of text entered.
cat <<EOF>> /etc/profile.d/java.sh
export JAVA_HOME=/opt/jre1.6.0_18
export PATH=\$JAVA_HOME/bin:\$PATH
EOF -
NOTE: This part must be executed as root and using root's PATH. Root's PATH is obtained by using 'su --login' NOT sudo or 'su' on it's own.
In the terminal (which should still be open) type:
source /etc/profile.d/java.sh
-
Hit enter, then type the following.
/usr/sbin/alternatives --install /usr/bin/java java /opt/jre1.6.0_18/bin/java 2
-
Hit enter, then type the following.:
/usr/sbin/alternatives --config java
-
Hit enter, Then the following text should be displayed.
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
+ 1 /opt/jre1.6.0_18/bin/java
* 2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
Enter to keep the current selection[+], or type selection number: -
Enter the number that references the version of java you installed, in this case 1. Type 1 then press enter.
1
Note: or choose the selection for /opt/jre1.6.0_13/bin/java
-
Hit enter, then type the folllowing.
/usr/sbin/alternatives --display java
-
Hit enter, then a line similar to the following should be displayed.
java - status is manual.
link currently points to /opt/jre1.6.0_18/bin/java
/opt/jre1.6.0_17/bin/java - priority 2
slave keytool: (null)
slave rmiregistry: (null)
slave jre_exports: (null)
slave jre: (null)
/usr/lib/jvm/jre-1.5.0-gcj/bin/java - priority 1500
slave keytool: /usr/lib/jvm/jre-1.5.0-gcj/bin/keytool
slave rmiregistry: /usr/lib/jvm/jre-1.5.0-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.5.0-gcj
slave jre: /usr/lib/jvm/jre-1.5.0-gcj
Current `best' version is /usr/lib/jvm/jre-1.5.0-gcj/bin/java. - Then perform the following:
sed -i 's/XINERAMA/FAKEEXTN/g' /opt/jre1.6.0_18/lib/i386/xawt/libmawt.so
-
Close all instances of Firefox and restart for the plug-in to function properly.
-
You should now be able to install and run Java applications.
Troubleshooting
How to test
Common problems and fixes
If JAVA applications do not run after restarting firefox, you may need to check your /var/log/audit/audit.log. If you see messages similar to the following "type=AVC msg=audit(1144977424.506:73): avc: denied { execmod } for pid=3005 comm="java_vm" name="libdeploy.so" dev=dm-0 ino=3274482 scontext=user_u:system_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0 tclass=file" you may need to fix the SELINUX context by doing the following as root:
chcon -t textrel_shlib_t /opt/jre1.6.0_18/lib/i386/libdeploy.so
Removing An Old Alternative for Java
For example, if you have installed jre1.6.0_06 and want to remove jre 1.6.05, do the following:alternatives --remove java /opt/jre1.6.17/bin/java

