Java virtuals

Currently we have packages like sun-jaf that are reference implementations for a JSR and have since been incorporated into the JRE (>=1.6). So before introducing Java virtuals ebuild developers had to either depend on sun-jaf or a new enough JDK version. Tomcat used the java5 use flag to select between the two options. This of course is not ideal for users and as such we added support for virtuals into java-config. We are still in the early stages of converting stuff to virtuals and let’s see how it takes as the work is quite boring. Any way here is a demonstration of the jaf virtual in use:

betelgeuse@pena ~ $ GENTOO_VM="sun-jdk-1.5" java-config -p jaf
betelgeuse@pena ~ $ GENTOO_VM="sun-jdk-1.6" java-config -p jaf

betelgeuse@pena ~ $

jaf was introduced in 1.6 so in the first case you need the separate package and in the second case there is no point in polluting the classpath with extra stuff as we already have it in the JDK. On the ebuild side you use the same functions as with normal packages but you have to add the –virtual parameter to java-pkg_jar-from and java-pkg_getjar calls so that they don’t record individual jars.