How to integrate gcj'ed library with JVM library..
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Tue Sep 25 23:06:00 GMT 2001
þÃÂûóðàwrote:
>Hello, all ~~
>I'm studying about Java VM perfomance optimization.
>I want to use gcj as the optimization skill(ahead of time compiler).
>The purpose is to convert the java system classes into shared library
>using gcj and to integrate(link)
>gcj'ed shared library with other JVM library..
>So, I already built gcc-3.0 on x86/Linux platform and succeeded
>converting..
>but I don't know how to link...
>So.... In rough way, I tried to use JNI skill.('native' keyword and
>System.loadLibrary())
>For example, there is two java program, A.java and B.java.
>A.java uses the method of B.java.
>I compiled A.java by javac and B.java is converted to shared
>library(libhello.so) by gcj..
>( command : gcj -shared -o libhello.so B.java )
>I executed A.class by command(java A), I got an error..
>
Hi ~~
This won't work. You can't load GCJ compiled object code into Sun's JVM,
the runtimes are simply not compatible. If you want to integrate
pre-compiled classes with a traditional JVM, you might wan't to look at
the "Kaffe" VM, which has some support for running GCJ-compiled code on
its runtime. I don't know how well this works, however. Also, libgcj has
a built in Java interpreter, so its possible to mix .class files with
compiled classes in an application without a 3rd-party JVM.
regards
Bryce.
More information about the Java
mailing list