MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!


 
 

*DocIndex - Utils & Apps

Installing Java

* Introduction
* Installing Java
* Using Java In Your Browser
* Compiling Limewire

Related Resources:



Revision / Modified: Mar. 01, 2002 / Mar. 19, 2002
Author: Roger

 

(Contributed by Mandrake Linux user Roger roger6@6linuxfreemail.com (remove numbers))

Article Last Revised:  Sun Feb 24 09:32:13 EST 2002

* 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 larger!

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.4/download.html 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_4_0-fcs-linux-i386.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.

* section index * top

* 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 file! So onward we go:

  1. Type su on a terminal and enter your 'root' password.
  2. Uninstall kaffe: urpme kaffe
  3. Make Java installer package executable: chmod a+x j2sdk-1_4_0-fcs-linux-i386.rpm.bin
  4. Execute it: ./j2sdk-1_4_0-fcs-linux-i386.rpm.bin
  5. Install it (as 'root'): urpmi j2sdk-1_4_0-fcs-linux-i386.rpm

Create a file called 'java.sh' as 'root' in '/etc/profile.d' containing these lines:

JAVA_HOME=/usr/java/j2sdk1.4.0
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
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.

* section index * top

* 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, I had to do set up a file link by hand:

ln -s $JAVA_HOME/jre/plugin/i386/ns610/libjavaplugin_oji140.so \
/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 aretwo 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 ;-).

* section index * top

* Compiling Limewire

From the RPM description: Limewireis 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:

If you want to build the above two packages from source, you will also need these:

I have yet to see these packages within Mandrake's Contribs folder and this maybe due to licensing issues.
Mandrake Linux user and Cookerite Guillaume Rousse comments:

"Packages can not be included in Mandrake 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 Mandrake Linux :-).

Also, some of our work is currently being included into Mandrake 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".

* section index * top

 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.