This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Interface gcj-compiled library with Java programs in a runtime (other than gij)?
- From: Brian Jones <cbjones1 at gmail dot com>
- To: Yi Lin <qinsoon at gmail dot com>
- Cc: "java at gcc dot gnu dot org" <java at gcc dot gnu dot org>
- Date: Sun, 12 Feb 2012 23:00:49 -0500
- Subject: Re: Interface gcj-compiled library with Java programs in a runtime (other than gij)?
- References: <4F387D25.40406@gmail.com>
I suggest you try jni to get to whatever native code you are interested in.
Brian
On Feb 12, 2012, at 10:01 PM, Yi Lin <qinsoon@gmail.com> wrote:
> Hi,
>
> I am wondering if we can use methods from a gcj-compiled library in uncompiled Java program(bytecode) executed on a VM.
>
> According to gcj FAQ 1.7, there is no problem to do this with 'gij' interpreter/runtime. You can compile some Java code into library (native code), and run bytecode with 'gij' to invoke library methods. But this seems only capable for 'gij', and other runtimes like HotSpot cannot load and link the library properly.
>
> I want to know if there is a general solution to allow you interface uncompiled Java program with gcj-compiled library. Any information or reference about this will be appreciated.
>
> Many Thanks,
> Yi