This is the mail archive of the 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]
Other format: [Raw text]

Compile JNI with autotools?

I am trying to compile some JNI code using the GNU autotools.
Could anyone recommend a simple example

Currently, the final step in my compile process fails with the following error:

/bin/sh ../libtool --tag=GCJ --mode=link gcj  -g -O2   -o Test --main=Test Test.o -lz 
libtool: ignoring unknown tag GCJ
gcj -g -O2 -o .libs/Test --main=Test Test.o  ./.libs/ ./.libs/ -L/lib -lglib-2.0 -lz 
./.libs/ undefined reference to `hidden alias for void FmtPtrn::helloWorld()'
collect2: ld returned 1 exit status
make: *** [Test] Error 1

Everything works find with the following, manual build commands:

$ javac
$ java Test
Hello world!

Of course, in this case, the executable produced is not native.

Here are the relevant portions of my


# JNI C Code:
libnewfmt_ptrnjni_la_SOURCES = fmt_ptrnjni.c
libnewfmt_ptrnjni_la_LDFLAGS = -version-info @VER_INFO@ $(GLIB_LIBS)

# JNI Java Code:
libnewfmt_ptrnjava_la_SOURCES =

bin_PROGRAMS = new new_proj Test

Test_LDFLAGS = --main=Test
Test_LDADD =



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