This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Newbie
- From: Andrew Haley <aph at redhat dot com>
- To: Loïc Péron <loic dot peron at bigfoot dot com>
- Cc: java at gcc dot gnu dot org
- Date: Mon, 14 Oct 2002 17:15:27 +0100 (BST)
- Subject: Newbie
- References: <1034611431.3daaeae736d95@imp.free.fr>
=?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.