Java on Mandrake

Overview

Mandrake is distributed with the Open Source Blackdown virtual machine for running Java. If you need more than just a Java virtual machine, then you should download the j2se rpm from http://java.sun.com/j2se/downloads.html.

Installing Sun's j2se

Download the "Linux RPM in self-extracting file" from http://java.sun.com/j2se/downloads.html. Unless you know that you need the SDK, get the JRE version.

Many people tend to download the wrong thing or can't find the right file at java.sun.com. At the risk of having out-dated information here (Sun changes their webpage regularly), here are the links to follow as of January 2005:

  1. http://java.sun.com/j2se/downloads.html
  2. J2SE 1.4.2
  3. "Download J2SE JRE" (not the SDK or JREE!!)
  4. accept the agreement
  5. "RPM in self-extracting file"

If you can't find the above links, Sun changed their website again. Email me and I'll figure it out.

The following commands assume you downloaded "j2re-1_3_1_02". Since it is quite likely you've downloaded a different version, use common sense and adjust the commands accordingly:

(The italicized text indicates version-specific values that probably differ from what you just downloaded)
$ sh ./j2re-1_3_1_02-linux-i386-rpm.bin
  (read the license, using the space bar, confirm with "yes" at the end)
  (says, inflating: jre-1.3.1_02.i386.rpm)
$ su
# rpm -e kaffe (this command will fail if kaffe isn't installed, that's ok)
# rpm -Uvh jre-1.3.1_02.i386.rpm (use the filename it just inflated)
# ls /usr/java
jre1.3.1_02
# ln -s jre1.3.1_02 /usr/java/default  (use the directory name printed in the previous step)
# wget -O /etc/profile.d/j2se.sh http://speculation.org/garrick/j2se.sh
# wget -O /etc/profile.d/j2se.csh http://speculation.org/garrick/j2se.csh
# chmod 755 /etc/profile.d/j2se.sh /etc/profile.d/j2se.csh
# exit
$
** Now LOGOUT of X and log in again **

When you logout and login, you should have java in your path. Test this with 'which java', 'echo $PATH', and 'echo $JAVA_HOME'.

Java in Mozilla

Need java for your Mozilla or Mozilla-based browser (Galeon, Skipstone, Firefox(MozillaFirebird(phoenix)), etc.)? Unfortunately, blackdown doesn't provide a mozilla plugin, so you need to install Sun's j2se mentioned above. Be sure to observe the following things:

Sun's Java 1.4.2 has now two versions of the plugin. One for recent distros using the latest compiler and one for older distros. The plugin for recent distros has been put in the ns610-gcc32 directory. This is what you need for Mandrake 9.2 and later.

If you happen to have an older distro it comes down to where you have gotten your mozilla from. mozilla.org has started using gcc3 for all their recent releases. If you are still using mozilla distributed with Mandrake 9.1 or older you need to keep using the plugin from the ns610 directory.

After following instructions above and making sure which plugin version you need, run these two commands with the directories adjusted as needed:

# rm /usr/lib/mozilla/plugins/libjavaplugin_oji.so
# ln -s /usr/java/default/plugin/i386/ns610-gcc32/libjavaplugin_oji.so \
/usr/lib/mozilla/plugins/
Note:/usr/lib/mozilla may not be correct on your system. 'ls -ld /usr/lib/moz*' may reveal the correct directory. The link to the plugin inside /usr/java/default may be different, particularly, the "ns610" directory; again, use common sense. Then restart your browser. Java applets should now be working for all of your mozilla-based browsers (except konqueror). There's a small Java Applet at the bottom of this page to test.

Note: I've just learned at least 1.4.2 is required for recent Mozilla and Firefox(Firebird) builds.

To recap, these are the software versions that switched to gcc3: mdk9.2, mozilla.org's recent binary releases, sun j2se 1.4.2.

Java in Konqueror

Konqueror's setup is explained here.
One user stated that the above version of java will work with konqueror, but you have to restart it. When konq prompts for the name of java, enter "/usr/java/default/bin/java".

Other Sources of Information

I'm far a from a Java guru. The information above was just gleened over time. If you are interested in more information on Java in Linux, read the Enterprise-Java-for-Linux-HOWTO

Java Applet Demo

You should see some fancy flying text on a black background...

Java is currently NOT working with the <object> tag (not support by konqueror)

Java is currently NOT working with the <applet> tag

Back to Top level page

Flames and well-wishes to garrick@speculation.org
All content is © 2002-2004 Garrick Staples,
Registered Linux User #264142.
Valid XHTML 1.1! Cynthia Tested! Valid CSS!
Created with Vim! Powered by Mandrake!