Here are some terms you might find useful before starting.
If you are using the stable tree, ie x86, ppc, or amd64 as opposed to ~x86, ~ppc,
or ~amd64, you will need to add some entries to your
=sys-apps/portage-2.1*
dev-java/ant-core
dev-java/ant-tasks
dev-java/ant
dev-java/blackdown-jdk
dev-java/blackdown-jre
dev-java/eclipse-ecj
dev-java/ibm-jdk-bin
dev-java/ibm-jre-bin
dev-java/java-config
dev-java/java-config-wrapper
dev-java/javatoolkit
dev-java/jikes
dev-java/jrockit-jdk-bin
dev-java/kaffe
dev-java/sun-jdk
dev-java/sun-jre-bin
A new package, java-config-wrapper, is blocked by old versions of java-config, so we should remove that first:
emerge -C java-config
Now we should install the new versions of java-config:
emerge =java-config-1* =java-config-2*
We now provide a new script,
/usr/bin/java-check-environment
which leads us to...
The first section checks for old java-config files in
The next section that java-check-environment will friendily warn you about is that you have Generation-1 configurations in your home directory. These files are no longer supported in their current form. As advised, you should run:
java-config-2 -L
java-config-2 -s
The next possible set of errors is that you don't have a Generation-1 System VM. For axxo-overlay users, you most likely don't have this. To fix this, run:
java-config-1 -L
java-config-1 -S
Of course, as per usual, you will need to run
env-update && source /etc/profile
To make sure you get the right environment.
The next check is if you have a 1.5 JDK for a system vm for Generation-1. You should be using a 1.4 JDK instead. If you have been following this guide to this point, simply follow the instructions above for setting a new system vm for Generation-1.
Chances are good that you have some bytecode compiled for 1.5. This can lead to problems with UnsupportedClassVersionErrors?. To attempt to fix this, try running:
/usr/bin/java-1.5-fixer
Some applications figure out how to call java from JAVA_HOME. As is, JAVA_HOME
will be what your system-vm for generation-1 is set to (ie
One workaround is to do the following to set JAVA_HOME:
if [[ -L $HOME/.gentoo/java-config-2/current-user-vm ]]; then
export JAVA_HOME=$HOME/.gentoo/java-config-2/current-user-vm
elif [[ -L /etc/java-config-2/current-system-vm ]]; then
export JAVA_HOME=/etc/java-config-2/current-system-vm
fi
You could include this in your .bash_profile, but it isn't recommended. This is because you remain tethered to your environment, which the new system helps eliminate. For example, if you don't have a user-vm set, you'll get the system-vm. If you later set a user-vm, you'll need to source ~/.bash_profile to get the right JAVA_HOME.
DO NOT USE THIS IN YOUR ROOT USER'S bash_profile!!! It will likely break generation-1 packages if you have a 1.5 VM as the generation-2 system vm.
The better approach would be to migrate the application to the new build system, and ensure that it works properly. If you do run into any particular applications that suffer from this problem, please contact nichoj in #gentoo-java or drop a message to the gentoo-java mailing list.