Gentoo provides numerous JDKs and JREs. The default is the Blackdown JDK/JRE pair, as it is freely (beer) available without any registration fuss.
Both the Sun JDK/JRE and the IBM JDK/JRE are generally faster, but getting them is a bit more work, as you are required to read and accept their license before downloading (IBM additionally requires you to register).
Our ebuilds for the Sun and IBM JDK/JREs will notify you of where to go to download them.
If you run
You should download the indicated file(s) into
Gentoo has the ability to have multiple JDKs and JREs installed without them conflicting. There are a few caveats to this, as noted below.
Using the
Running the command
[%1 ~] java-config --list-available-vms [blackdown-jdk-1.3.1] Blackdown JDK 1.3.1 (/etc/env.d/java/20blackdown-jdk-1.3.1) [blackdown-jre-1.3.1] Blackdown JRE 1.3.1 (/etc/env.d/java/20blackdown-jre-1.3.1) [ibm-jdk-1.3.0] IBM JDK 1.3.0 (/etc/env.d/java/20ibm-jdk-1.3.0) [ibm-jdk-1.3.1] IBM JDK 1.3.1 (/etc/env.d/java/20ibm-jdk-1.3.1) [ibm-jre-1.3.1] IBM JRE 1.3.1 (/etc/env.d/java/20ibm-jre-1.3.1) [sun-jdk-1.4.0] Sun JDK 1.4.0 (/etc/env.d/java/20sun-jdk-1.4.0)
The name in the brackets
[#1 ~] java-config --set-system-vm=ibm-jdk-1.3.1 Now using IBM JDK 1.3.1 (/etc/env.d/java/20ibm-jdk-1.3.1)
Once you have issued
[#1 ~] env-update
After this, you will either want to relogin, or resource
As a regular user, you can use
First you want to list available java libraries that might be interesting to put in your CLASSPATH, thus:
[%1 ~] java-config --list-available-packages [ant] No description (/usr/share/ant/classpath.env) [java-gnome] No description (/usr/share/java-gnome/classpath.env) [java-gtk] No description (/usr/share/java-gtk/classpath.env) [log4j] "" (/usr/share/log4j/package.env)
Again, the name in brackets
java-config --set-system-classpath=log4j,java-gtk,java-gnome
Again, you will want to run
For users,
If you select a JRE as your default VM, you may not have a
Jikes will be used to compile some of the largest packages, if it is available. With time, we hope to be able to compile all java-dependent packages with Jikes, so some dependencies on the JDK can be replaced with a dependency on the JRE.
With some versions of Portage, doing an