Installing Java
Summary:
Introduction
I've made some notes here for anybody else installing J2RE/J2SDK from java.sun.com.
J2RE (Java Runtime Environment)
This is for end-users only wanting to execute java applications.
J2SDK (Java Software Development Kit)
For developers or anybody wanting to compose & compile Java applications. This package also includes the J2RE package, listed above, so this package is obviously a bit larger1.1
For the sake of my sanity, we'll discuss a J2SDK installation. Persons installing the J2RE package will only need to modify their folders to show 'j2re/' instead of 'j2sdk/' (the Java Home is either '/usr/java/j2reversion' or '/usr/java/j2sdkversion').
One can acquire the J2SDK package at http://java.sun.com/j2se/1.5.0/download.jsp and download the appropriate package for your distribution (we shall assume Mandrake Linux or Red Hat here). Choosing the RPM version, the website will give you the package "j2sdk-1_5_0-linux-i586.rpm.bin".
I will then continue to briefly explain how to compile Limewire for no particular reason. This is probably the part where users "only worried about installing the J2RE environment" can safely ignore the rest of the article.
Installing Java
I uninstalled kaffe as it's '/usr/bin/java' appears to conflict with J2SDK/J2RE. Although, I'll note here that the j2sdk.rpm does not complain about kaffe when installing. Nor does the j2sdk.rpm modify your .bashrc file1.1 So onward we go:
- Type su on a terminal and enter your 'root' password.
- Uninstall kaffe: urpme kaffe
- Make Java installer package executable: chmod a+x j2sdk-1_5_0-fcs-linux-i386.rpm.bin
- Execute it: ./j2sdk-1_5_0-fcs-linux-i386.rpm.bin * Install it (as 'root'): urpmi j2sdk-1_5_0-fcs-linux-i386.rpm
JAVA_HOME=/usr/java/j2sdk1.5.0<br> export JAVA_HOME<br> PATH=$PATH:$JAVA_HOME/bin<br> export PATH
Make it executable with
chmod +x /etc/profile.d/java.sh
From now on, both variables will be set in all newly opened shells or terminals.
You may wish to create symlinks (this is ugly but convenient) in /usr/bin to the sun java programs. eg: ln -s /usr/java/VERSION/bin/java /usr/bin/ and likewise for 'jar' and 'javac'. If you have kaffe installed, these symlinks will already exist, pointing to /etc/alternatives/; you can safely delete them.
Using Java In Your Browser
For Netscape-4, add this to your '.bashrc' (preferably immediately following the section #JAVA). This will enable the 'enablePlugin JVM' in 'Edit > Preferences > Advanced':
export NPX_PLUGIN_PATH=$JAVA_HOME
For Mozilla / Firefox, I had to do set up a file link by hand:
- For JRE 1.4.2 ln -s $JAVA_HOME/jre/plugin/i386/ns610/libjavaplugin_oji140.so <br> /usr/lib/mozilla/plugins/
- For JRE 5.0 (1.5.0) ln -s $JAVA_HOME/jre/plugin/i386/ns7/libjavaplugin_oji.so <br> /usr/lib/mozilla/plugins/
Notice that this makes the plugin available to the Galeon browser, too. If you are using J2RE instead of J2SDK, you have to remove the 'jre' directory from the command line above. If you already have a Java plugin for Mozilla, you have to rename it before issuing the command.
Netscape 6.x requires the same procedure as Mozilla.
In Opera 6 for Linux, go via 'File < Preferences < Multimedia < Plug-ins' and click on the 'Modify Path' button to add the directory with SUN's Java plugin to Opera's plugin path. Notice that there are two plugin directories, 'ns4' and 'ns600'. Try 'ns4' first.
For Konqueror, go via 'Settings < Configure Konqueror < Konqueror Browser < Java'. Check 'Enable Java Globally' and adjust entry in the 'Path to java executable' field by clicking on the small directory icon and browsing to the 'bin' directory of your Java installation.
In Lynx, you have to … hehe, just kidding ;-).
Compiling Limewire
From the RPM description: Limewire is a Gnutella client written in Java. It supports a number of advanced features like 'ultrapeers' (like ~FastTrack's supernodes), automatic download retries, freeloader punishment, etc.
I will briefly advise you on the basics of compiling Limewire.
The packages that the build of Limewire depends on are:
- antlr-2.7.1-2.noarch.rpm
- junit-3.7-2.noarch.rpm
- oro-2.0.3-2.noarch.rpm
- regexp-1.2-5.noarch.rpm
- xalan-j-2.1.0-2.noarch.rpm
Mandriva Linux user and Cookerite Guillaume Rousse comments:
>
>"Packages can not be included in Mandriva main or the contribution section if they have external dependencies. This means only Java applications running with kaffe or another free JVM (as japhar, gcj, etc..) can be included, which is actually really restrictive, as kaffe is not Java2-compliant.
>
>Fortunately, the JPackage project provides a coherent distribution of more than 100 different Java applications as standard RPM packages, including all cited in this article. Since half of the project contributors are Cooker folks, they are guaranteed to run on Mandriva Linux :-).
>
>Also, some of our work is currently being included into Mandriva commercial section, so you should see an official Mdk 'tomcat' package very soon."
Of course, you should already have the J2SDK installed as instructed above.
From here, you can either download the limewire-%{version}.src.rpm from rpmfind.net and issue (as 'root'):
rpm ––rebuild ––clean limewire-version.src.rpm
Or you can download a stable or cvs copy from Limewire.org directly. Once downloaded unzip/untar it and enter the 'core/' & 'gui/' folders and execute the script file:
./compile
Really tuff eh? Btw, the compile script file only contains one command called "ant".
Related Resources
Mandriva provide his own j2re and j2sdk package in Mandrakeclub commercial packages (Thank to Lenny Cartier 1.1 ). Note that it will install in a different location : /usr/lib/ 1.1 It creates the /etc/profile.d/jre-xxx.sh file. For now only 1.4.2_07, no 5.0.
(Note : You can see if there is a different installation script with rpm -q ––script j2re (or "jsdk").)
You may look at IBM's Jikes too.
Revision / Modified: Mar. 01, 2002 / Mar. 19, 2002 Author: Roger
Revision / Modified: 23-03-2005 Author: Bruno
Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
(Contributed by Mandriva Linux user Roger (remove numbers) and Bruno .)
Article Last Revised: 02-11-2004
Version 1.28 last modified by tuforne on 23/04/2008 at 17:26
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!
Comments (1)