jGuru
Register Email     Password Forgot your
password?
HOME FAQS FORUMS DOWNLOADS ARTICLES PEERSCOPE LEARN

  Search   jGuru Search Help

Question Can I install multiple Java environments on my Linux box?
Topics Platform:UNIX:Linux
Author Nathan Meyers PREMIUM
Created Sep 17, 2000 Modified Sep 17, 2000


Answer
Yes... the trick is not to get confused about which one you are using. There are basically three environment variables that are important in choosing your Java environment:
  • PATH controls where executables will be found - make sure the executables you want will be found first.
  • CLASSPATH controls where classes will be found. Different environments have different requirements for the CLASSPATH - you often do not need to set it at all. But if you do set it, be sure not to include components from Java environments other than the one you're running.
  • JAVA_HOME is not used by JDK1.2 and later environments, but some earlier Java environments did use it, and some scripts depend on it. If this variable is set, make sure that it does not point to a different Java installation than the one you're trying to use.

A common, and very confusing, situation is to have a Sun JDK and Kaffe installation on the same box - many Linux distributions now routinely install Kaffe, placing the executables in /usr/bin. Since Kaffe includes executables named java, javac, appletrunner, and such, you will end up running those executables instead of Sun JDK executables unless you put the JDK bin/ directory earlier in the path. As Kaffe does not support a significant subset of the JDK1.2 spec, many 1.2 applications and applets will fail to run or find needed classes. Results can also get extremely strange if you mix the Kaffe JVM with Sun's JDK classes, or vice versa.



Is this item helpful?  yes  no     Previous votes   Yes: 0  No: 0



Comments and alternative answers

Comment on this FAQ entry

There are currently no comments

Ask A Question



 
Related Links

Linux FAQ

Linux Forum

The Blackdown Organization - porting Java for multiple Linux platforms

Sun's JDK1.2.2 for Linux

IBM's JDK1.3 for Linux

Kaffe - a cleanroom Java implementation

gcj - the Gnu Compiler for Java

Java Programming on Linux (book by FAQ manager)

Wish List
Features
About jGuru
Contact Us

 



The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers