This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: jc1: Can't find default package 'java.lang'
- To: Dachuan Yu <dachuan dot yu at yale dot edu>
- Subject: Re: jc1: Can't find default package 'java.lang'
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Mon, 24 Sep 2001 13:49:57 -0700 (PDT)
- Cc: java at gcc dot gnu dot org
- References: <3BAF9214.507CCA74@yale.edu>
- Reply-To: apbianco at cygnus dot com
Dachuan Yu writes:
> If I understand it correctly, what happens is that gcc calls "jc1"
> as the first step to compile the A.java file into a temporary
> blahblah.s file.
Yes.
> However, if I run "jc1" using command line with some arguments (here
> I'm using the same arguments that gcc would use to call "jc1",
> except the output file name) as follows:
`gcj -v ...' will tell you exactly what the arguments passed down to
jc1 are. For example, I get that the jc1 invocation should be in my
test case:
/home/apbianco/install/egcs-devel/install-x86/lib/gcc-lib/i686-pc-linux-gnu/3.1/jc1 XXX.java -fhash-synchronization -fno-use-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fkeep-inline-functions -quiet -dumpbase XXX.java -g1 -version -fPIC -o /tmp/<some-temp-file>
If I run it this way, jc1 will tell me what is the class path it's
using (it also does when you provide gcj with the `-v' option.) In this
case it's:
Class path starts here:
./
/home/apbianco/install/egcs-devel/install-x86/share/libgcj.jar/ (system) (zip)
> A.java:0: Can't find default package `java.lang'.
> Check the CLASSPATH environment variable and the
> access to the archives.
> A.java:0: confused by earlier errors, bailing out
> Could anybody tell me what's wrong and/or how to fix
> it?
I don't understand what's wrong, apart from the fact that you might be
running the wrong jc1. Does `gcj -v ...' provide you with a class path
dump? Is jc1 telling that it uses the same class paths when you run it
by hand?
> I wanted to do this because I was using gdb to
> follow "jc1". But I couldn't get into the real stuff
> because of the error.
Note that a suitable breakpoint to look at what's happening inside jc1
would be jcf-parse.c:yyparse (b yyparse.)
./A