- Fedora Core provides an open source implementation of Java. See http://fedora.redhat.com/docs/release-notes/fc5/test3-latest-en/#sn-Java for information about this. However many users, myself included, prefer Sun Java for their purposes. To install Sun Java open Firefox, go to http://java.sun.com/j2se/1.5.0/download.jsp, click on Download JRE 5.0 Update 8, click the radio button to accept the license agreement, under "Linux Platform - J2SE(TM) Runtime Environment 5.0 Update 8" click on "Linux self-extracting file", to download jre-1_5_0_08-linux-i586.bin (save to disk). This should save the file to your home folder. If it saves the file to your desktop instead go to your desktop and drag the file into your "Home" folder. (Left mouse click on the file and drag it on top of your "Home" folder while holding the left mouse button down. Then release the mouse button.)
- If you have not already done so go to "System" > "Administration" > "Security Level and Firewall". Enter your root password and click "ok". On the "SELinux" tab click on "Modify SELinux Policy", click on "Compatibility" to open it and tick the check box next to "Allow the use of shared libraries with Text Relocation". Click "ok". Reboot your machine to implement the new SELinux policy.
- Open a terminal. Type:
su
- Type:
mv *.bin /opt
- Type:
cd /opt
- Type:
chmod +x *-linux-i586.bin
- Type:
./*.bin
- Type:
rm *.bin
- Type:
su -
- Type:
ln -s /opt/jre1.5.0_08/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so
(If you wish to install the JDK which includes the Java development environment rather than the JRE download the JDK .bin file from Sun instead of the JRE .bin file, substitute "jdk1.5.0_08" for "jre1.5.0_08" in the commands above and below and use "ln -s /opt/jdk1.5.0_08/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so" rather than "ln -s /opt/jre1.5.0_08/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so" to create the browser plugin.)
We are not done with Java quite yet, even though your browser plugin is working. Please proceed to the next step.
- If you wish to run Java applications such as LimeWire, JAlbum or Azureus and you have installed the Sun J2SE JRE into /opt as described above, open a terminal and type:
su -
- Type:
gedit /etc/profile.d/java.sh
- In gedit type or copy and paste these lines:
export J2RE_HOME=/opt/jre1.5.0_08
export PATH=$J2RE_HOME/bin:$PATH
- In the terminal (which should still be open) type:
source /etc/profile.d/java.sh
- Type:
which java
- You should see:
/opt/jre1.5.0_08/bin/java
- Type:
/usr/sbin/alternatives --install /usr/bin/java java /opt/jre1.5.0_08/bin/java 2
- Type:
/usr/sbin/alternatives --config java
- You should see:
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
* 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
+ 2 /opt/jre1.5.0_08/bin/java
Enter to keep the current selection[+], or type selection number:
- Type:
2
- Type:
/usr/sbin/alternatives --display java
- You should see:
java - status is manual.
link currently points to /opt/jre1.5.0_08/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
/opt/jre1.5.0_08/bin/java - priority 2
slave rmiregistry: (null)
slave jre_exports: (null)
slave jre: (null)
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.
No comments:
Post a Comment