Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 19284 - gcj classpath not set in /etc/env.d/gcc files
Summary: gcj classpath not set in /etc/env.d/gcc files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Matthew Kennedy (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-14 04:37 UTC by Per Cederberg
Modified: 2004-05-13 11:19 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Per Cederberg 2003-04-14 04:37:22 UTC
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:
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-04-14 14:29:39 UTC
Can anybody that use gcj have a look.  Should it install a java-config profile ?
Comment 2 Dylan Carlson (RETIRED) gentoo-dev 2003-05-26 20:00:29 UTC
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. 
Comment 3 Matthew Kennedy (RETIRED) gentoo-dev 2003-05-28 04:21:16 UTC
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.
Comment 4 Matthew Kennedy (RETIRED) gentoo-dev 2004-02-28 15:17:06 UTC
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.
Comment 5 Matthew Kennedy (RETIRED) gentoo-dev 2004-05-13 11:19:26 UTC
done