From Fedora Project Wiki

Java Runtime Environment (JRE) on Firefox

Referred to "Fedora Core 5安装Java及FireFox的Java插件" (LUPA, 2006.) - http://bbs.lupaworld.com/htm_data/234/0608/21228.html

#!html
<br>

Here are the procedures of Firefox for running Java applets by (JRE):

#!html
<br>

1. Download self-decompression file (jre-1_5_0_06-linux-i586.bin) from http://java.sun.com

#!html
<br>

2. Install JRE on the system:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
mv jre-1_5_0_06-linux-i586.bin /opt <br><br>
.cd /opt <br><br>
chmod +x jre-1_5_0_06-linux-i586.bin <br><br>
./jre-1_5_0_06-linux-i586.bin <br><br>
ln -s /opt/jre1.5.0_06/plugin/i386/ns7/libjavaplugin_oji.so <br><br>
/usr/lib/mozilla/plugins/libjavaplugin_oji.so
</td></tr></table></center><br>

3. Java plugin has now been installed. It could be confirmed by the following command:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
ls -l /usr/lib/mozilla/plugins
</td></tr></table></center><br>

4. For executing Java applications such as limewire, continue:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
gedit /etc/profile.d/java.sh
</td></tr></table></center><br>

5. Insert the following content to such new document:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
JAVA_HOME=/usr/java/jre1.5.0_06 <br><br>
export JAVA_HOME <br><br>
JAVA_BIN=$JAVA_HOME/bin <br><br>
CLASSPATH=$CLASSPATH:$JAVA_HOME:$JAVA_HOME/lib <br><br>
PATH=$JAVA_BIN:$PATH <br><br>
export JAVA_BIN CLASSPATH PATH
</td></tr></table></center><br>

6. Save the edited document.

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
source /etc/profile.d/java.sh
</td></tr></table></center><br>

7. Install and configure JRE in alternatives:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
/usr/sbin/alternatives --install /usr/bin/java java /opt/jre1.5.0_06/bin/java 2 <br><br>
/usr/sbin/alternatives --config java
</td></tr></table></center><br>

8. The following contents will be displayed. Then input 2:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
There are 2 programs which provide 'java'. <br><br>
Selection Command <br><br>
----------------------------------------------- <br><br>
+ 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java <br><br>
2 /opt/jre1.5.0_06/bin/java <br><br>
Enter to keep the current selection[+] , or type selection number: <br><br>
</td></tr></table></center><br>

9. Test Java. For instance, the followings are the procedures for setup JPackage Java:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
Download jpackage nosrc rpm: <br>
wget http://mirrors.dotsrc.org/jpackage/1.6/generic/non-free/SRPMS/java-1.5.0-sun-1.5.0.06-1jpp.nosrc.rpm <br><br>

Download jdk-1_5_0_06-linux-i586.bin from Sun website and save to  /usr/src/redhat/SOURCES/ <br><br>

Rebuild the following package: <br>
rpmbuild --rebuild java-1.5.0-sun-1.5.0.05-1jpp.nosrc.rpm <br><br>

Install such packages: <br>
cd /usr/src/redhat/RPMS/i586 <br>
yum localinstall *.rpm<br>
</td></tr></table></center><br>

10. Create Jave plug-in link for Mozilla FireFox:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
ln -s /usr/lib/jvm/java-1.5.0-sun-1.5.0.05/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins
</td></tr></table></center><br>

Chinese/Japanese/Korean (CJK) Font Display Issues

There are many discussions regarding to CJK on the Internet. One could search for more information on Google. It is also necessary to check references of font configration on JRE version 1.5.0 from Sun.

Because there is a default fallback directory for JRE fonts, it would be a relatively esaier solution. i.e. to create a sub-directory "fallback". Then create a symbolic links in such directory which links to CJK fonts.

The followings use JPackage Java as example:

#!html
<center><table border="1" bordercolor="#FF8888" width="61.8%"><tr><td>
mkdir /usr/share/fonts/java/fallback <br><br>
ln -s /usr/share/fonts/yourfontdir/simsun.ttc /usr/share/fonts/java/fallback/simsun.ttc <br>
</td></tr></table></center><br>


Further resources regarding JRE and Chinese/Japanese/Korean (CJK)

http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html

http://gentoo-wiki.com/HOWTO_Enabling_Japanese#Java_1.5

http://developers.sun.com/dev/gadc/faq/java/files/cjkv.html

http://www.mozilla.org/releases/mozilla1.6/known-issues-int.html

http://forums.gentoo.org/viewtopic-p-1852138.html