Newbie

Andrew Haley aph@redhat.com
Mon Oct 14 09:14:00 GMT 2002


=?ISO-8859-1?Q?Lo=EFc=5FP=E9ron?= writes:
 > 
 > Hi,
 > 
 > I have a few gcj-newbie questions:
 > 
 > I understand gcj includes an interpreter for using
 > .class files that are not already compiled;
 > 
 > 1) how does this interact with compiled code? what
 >    have I to do in my code to be able to use it?

You can use "gij" to run a Java bytecode (i.e. .class) file.

You can also call Java's class loader from compiled native code to
load and run interpreted Java code .

 > 2) how do I produce compiled code linked against such
 >    java libraries for a mixed-mode application?

You don't link the compiled code with the bytecode.  You just use a
class loader at runtime to read in the class files.

Alternatively, you can directly call compiled code from intepreted
Java: this works by loading the compiled Java from a shared library,
which is a trick the interpreter can do.

Andrew.



More information about the Java mailing list