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


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

compiling java to native


Hi,

i am a trainee and i am interested in everything what have to do with
java.

My environment:
i386 P3 600 MHZ
SuSE Linux 7.2 ;-)
jdk1.3 and 1.3.1 is installed
gjava-2.95.3.52 compiled with gcc-2.95.3-52.src.rpm
JAVA_THREADS_TYPE="native"
(i hope this info help you)


So i found your pages and instructions, but i have the problem that i
can't compile with threads.

First test :
export CLASSPATH=$CLASSPATH:/usr/lib/jdk1.3/lib/tools.jar:/usr/lib/jdk1.3/lib/dt.jar:/usr/lib/jdk1.3/jre/lib/i18n.jar:/usr/lib/jdk1.3/jre/lib/rt.jar:/usr/lib/jdk1.3/jre/lib/sunrsasign.jar:/opt/USE/gclient/:.laptop:/opt/USE/gclient # gcj --main=client -o client client.java AnfrageThread.java Clients.java
(i don't know which jar-files are really needed)
gcj --main=client -o client client.java AnfrageThread.java Clients.java
(AnfrageThread and Clients are threads)

the output :
/tmp/cc0AQ4i9.o: In function `AnfrageThread::run(void)':
/opt/USE/gclient/AnfrageThread.java(.data+0xc4): undefined reference to
`java::lang::Thread::getContextClassLoader(void)'
/opt/USE/gclient/AnfrageThread.java(.data+0xc8): undefined reference to
`java::lang::Thread::setContextClassLoader(java::lang::ClassLoader *)'
/tmp/ccNpyITP.o: In function `Clients::run(void)':
/opt/USE/gclient/Clients.java(.data+0xa4): undefined reference to
`java::lang::Thread::getContextClassLoader(void)'
/opt/USE/gclient/Clients.java(.data+0xa8): undefined reference to
`java::lang::Thread::setContextClassLoader(java::lang::ClassLoader *)'
collect2: ld returned 1 exit status

If i compile with option --shared i get an segmentation fault when i start
the program.

Another problem is, that when try to compile a helloworld program and set
the CLASSPATH that the gcj compile, but the output e.g. "Hello World!"
does not occur but therefore a lot of unreadable caracters.
If i unset the CLASSPATH the output is correct.

im happy for any help - thank you !

-- 
Best regards
Markus

----------------------------------------------
Markus Meisters         SuSE GmbH, I-Support
Tel.:0911/740 53-374    Deutschherrnstr. 15-19
http://www.suse.de      90443 Nürnberg
______________________________________________


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