This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


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

Re: Does gcj support java program containing native c function?


Tom Tromey wrote:
> 
> >>>>> ">" == Liu, Guangsheng <Guangsheng.Liu@Dialogic.com> writes:
> 
> >> java.lang.UnknownError: Runtime.loadLibrary not implemented
> >>   By the way, I am using Red Hat 6.2, Java JDK1.2.2, libgcj 2.95.1.
> >>   Any idea or suggestion will be highly appreciated.
> 
> JNI wasn't implemented when libgcj 2.95.1 was released.
> However, it has been implemented since then.
> If you try a newer gcj+libgcj, your example ought to work.

An alternative for C++/Java integration is CNI, if you aren't concerned about
portability to other Java runtimes.  CNI is used throughout libgcj, and is much
more streamlined than JNI.

--
Jeff Sturm
jeff.sturm@commerceone.com

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