This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: jc1: Can't find default package 'java.lang'


Alexandre Petit-Bianco wrote:

> `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:

This is rather convenient! I didn't know that.

> 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:

I tried using -v. However, it didn't tell me what the class path was.

> 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?

It wasn't the wrong jc1 because I was using absolute path. Neither
"gcj -v" nor "jc1" tells me the class path. How do I explicitly specify
the class path? "--classpath=..." and "--CLASSPATH=..." didn't
seem to help either.

I'm attaching my output below. Hope that's not too annoying.

> Note that a suitable breakpoint to look at what's happening inside jc1
> would be jcf-parse.c:yyparse (b yyparse.)

Thank you!

Dachuan

*****************
[dachuan@vodka lab]$ /usr/home/dachuan/gcc/bin/gcj -v -shared -fPIC -o A.so A.java
Reading specs from /usr/home/dachuan/gcc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Reading specs from /usr/home/dachuan/gcc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0/../../../libgcj.spec
rename spec lib to liborig
rename spec startfile to startfileorig
Configured with: ../gcc/configure --enable-threads=posix --prefix=/home/joerg/gcc --enable-shared --enable-languages=c++,java --with-as=/opt/gnu/bin/as --with-ld=/opt/gnu/bin/ld
Thread model: posix
gcc version 3.0
 /usr/home/dachuan/gcc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0/jc1 A.java -fuse-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -quiet -dumpbase A.java -g1 -version -fPIC -o /tmp/dachuan/ccwF3OOS.s
GNU Java version 3.0 (i686-pc-linux-gnu)
 compiled by GNU C version 3.0.
 as --traditional-format -V -Qy -o /tmp/dachuan/cciQRn5F.o /tmp/dachuan/ccwF3OOS.s
GNU assembler version 2.9.1 (i386-redhat-linux), using BFD version 2.9.1.0.23
 /usr/home/dachuan/gcc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0/collect2 -m elf_i386 -shared -o A.so /usr/lib/crti.o /usr/home/dachuan/gcc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0/crtbeginS.o -L/usr/home/dachuan/gcc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0
-L/usr/home/dachuan/gcc/bin/../lib/gcc-lib -L/usr/home/dachuan/gcc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0/../../.. /tmp/dachuan/cciQRn5F.o -lgcc_s -lgcc -lgcj -lm -lgcjgc -lpthread -lzgcj -ldl -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/home/dachuan/gcc/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.0/crtendS.o /usr/lib/crtn.o
[dachuan@vodka lab]$ /usr/home/dachuan/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.0/jc1 A.java -fuse-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -quiet -dumpbase A.java -g1 -version -fPIC -o /tmp/dachuan/ccwF3OOS.s
GNU Java version 3.0 (i686-pc-linux-gnu)
 compiled by GNU C version 3.0.
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
[dachuan@vodka lab]$

*************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]