In order to compile Java sources properly with gcj, the CLASSPATH variable must be set properly. Currently, the CLASSPATH variable is not set in the /etc/env.d/gcc/* files, but only by various JDK:s and java-packages. This cause some problems for users of gcj, having to specify the classpath on the command-line. The errors reported by gcj looks like the following two examples (with wrong or missing classpath): "the `java.lang.Object' that was found in `/opt/sun-jdk-1.4.1.02/jre/lib/rt.jar' didn't have the special zero-length `gnu.gcj.gcj-compiled' attribute." "Can't find default package `java.lang'." A workaround to this is to use the "--classpath=..." command-line switch. This is not obvious for many users, however, and is hard to remember (if an alias is not setup). By adding the following line in /etc/env.d/gcc/i686-pc-linux-gnu-3.2.2 (or similar files) this problem can be solved altogether instead: CLASSPATH="/usr/share/gcc-data/i686-pc-linux-gnu/3.2/java/libgcj-3.2.2.jar" The solution of adding gcj to the classpath has been proposed by users in the forums (http://forums.gentoo.org/viewtopic.php?t=33969). So far, no errors have been reported by users running both gcj and other javac:s. Reproducible: Always Steps to Reproduce:
Can anybody that use gcj have a look. Should it install a java-config profile ?
I have no problem with this; however mkennedy was the one who was chiefly going to pursue the GCJ/GIJ stuff. He might be the best person to ask. I don't use gcj myself and consider its use experimental at this stage.
we need to make a jdk out of gcc basically and then add another profile. redhat shipped such a thing since 8.0 (hardly experimental ;), i'll be starting there.
The solution will be to leave CLASSPATH unset for all java packages in portage (including JDKs and JREs of course). This has been described on the gentoo-java list. After that the plan is to provide a JDK/JRE interface to GCJ/GIJ so that it can be used similarly.
done