0

Hello i need help about building artefact for Java. I get an error when running this command for build:

./configure --with-vpnc-script=~/Downloads/vpnc-script --with-java=/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home --disable-nls.

This is the error that i get:

checking jni.h usability... no configure: error: unable to compile JNI test program

I need your help please. I'm using release version 8.08 and building it on mac. This is the official gitlab repository

Here is the content of config.log generated

Thanks

Botje
  • 26,269
  • 3
  • 31
  • 41

1 Answers1

1

It seems that configure script expects you to pass the path to the JDK's include directory, not the JDK itself.

This should work:

--with-java=/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/include
Botje
  • 26,269
  • 3
  • 31
  • 41
  • Is the output in config.log the same? – Botje Apr 17 '20 at 08:16
  • [Here is the new outup](https://drive.google.com/file/d/1VINPS8qH4le3GuqWPiIkHS9Ln9M3IkZk/view?usp=sharing) – Armel Gildas Fagbedji Apr 17 '20 at 08:34
  • So yes, it is complaining about missing jni_md.h. Can you try with just `--with-java` ? That should try to locate the JDK. – Botje Apr 17 '20 at 08:52
  • [Here is the new output using --with-java](https://drive.google.com/file/d/1mx3Ib754dlYOFgm6MXnoVwt8lQOQMO8H/view?usp=sharing) – Armel Gildas Fagbedji Apr 17 '20 at 09:30
  • 1
    It looks like that configure script expects a different directory structure somehow. Symlink or copy all the headers under `/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home/include/darwin` to the directory above (`.../include`), then try again with my answer. – Botje Apr 17 '20 at 09:42
  • Great [Here is the new output using your answer](https://drive.google.com/file/d/1einK-NinEDBzqMHVvQd0Ys7Chak3EiQr/view?usp=sharing). Is it good? – Armel Gildas Fagbedji Apr 17 '20 at 09:51
  • 1
    Looks okay, yes. – Botje Apr 17 '20 at 09:53
  • But look this, my goals is to build the jar that i can use in an android module to handle VPN connection. Can you instruct me to guide me achieve my goal please? – Armel Gildas Fagbedji Apr 17 '20 at 09:58
  • 1
    That is a wholly different question. Start by reading the [documentation on cross-compilation](https://developer.android.com/ndk/guides/other_build_systems#autoconf) – Botje Apr 17 '20 at 10:01
  • Thanks a lot, i will follow instructions over there and comme back to you if get stuck – Armel Gildas Fagbedji Apr 17 '20 at 10:11
  • Following the readme inside de java folder of openconnect 8.08 release, i get another mistake when running make after ./configure. Here is the error: `/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive CC libopenconnect_la-version.lo CC libopenconnect_la-ssl.lo In file included from ssl.c:41: ./openconnect-internal.h:102:10: fatal error: 'libxml/tree.h' file not found #include ^~~~~~~~~~~~~~~ 1 error generated. make[1]: *** [libopenconnect_la-ssl.lo] Error 1 make: *** [all] Error 2` – Armel Gildas Fagbedji Apr 17 '20 at 10:39
  • Did you [install libxml2 as directed](https://www.infradead.org/openconnect/building.html)? – Botje Apr 17 '20 at 10:48
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/211862/discussion-between-botje-and-armel-gildas-fagbedji). – Botje Apr 17 '20 at 11:10
  • Hello, please i need your help one more time again – Armel Gildas Fagbedji Apr 17 '20 at 15:13
  • Ask a new question. – Botje Apr 17 '20 at 15:15
  • When i follow [instructions here](https://developer.android.com/ndk/guides/other_build_systems#autoconf), i get this error: `clang: error: no such file or directory: '../.libs/libopenconnect.so' make[2]: *** [serverhash] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2` Need your help please – Armel Gildas Fagbedji Apr 17 '20 at 15:18
  • [Here is my new question](https://stackoverflow.com/questions/61275196/error-when-using-the-ndk-with-other-build-systems-on-openconnect-8-08) – Armel Gildas Fagbedji Apr 17 '20 at 15:31