I'm trying to use hawtjni 1.8 for the first time to run the simple "printf" example from the documentation.
I've made a "Simple" java class as shown in the documentation (attached). I've also attached my pom.xml.
It appears the maven-hawtjni-plugin is generating native files based on my maven artifact id (test). Several files get generated and the plugin tries to compile them with gcc. This fails because some files include a "test.h" that didn't get generated.
I've tried changing my maven artifactId in my pom.xml. This changes the name of the not-generated header file that .c files expect, but the results are the same.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ test ---
[INFO] Deleting /home/aaron/workspace/hawt-jni/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ test ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ test ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /home/aaron/workspace/hawt-jni/target/classes
[INFO]
[INFO] --- maven-hawtjni-plugin:1.8:generate (default) @ test ---
[INFO] Analyzing classes...
[INFO] Generating...
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/test.c
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/test_stats.h
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/test_stats.c
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/test_structs.h
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/test_structs.c
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/hawtjni.h
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/hawtjni.c
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/hawtjni-callback.c
[INFO] Wrote: /home/aaron/workspace/hawt-jni/target/generated-sources/hawtjni/native-src/windows/stdint.h
[INFO] Done.
[INFO] executing: /bin/sh -c ./autogen.sh
[INFO]
[INFO] --- maven-hawtjni-plugin:1.8:build (default) @ test ---
[INFO] executing: /bin/sh -c ./configure --disable-ccache --prefix=/home/aaron/workspace/hawt-jni/target/native-build/target
[INFO] executing: /bin/sh -c make install
[INFO] CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/aaron/workspace/hawt-jni/target/native-build/autotools/missing --run aclocal-1.11 -I m4
[INFO] /usr/share/aclocal-1.11/ar-lib.m4:15: AM_PROG_AR is expanded from...
[INFO]
configure.ac:37: warning: AC_PROG_LIBTOOL was called before AM_PROG_AR
[INFO] /usr/share/aclocal-1.11/ar-lib.m4:15: AM_PROG_AR is expanded from...
[INFO] cd . && /bin/bash /home/aaron/workspace/hawt-jni/target/native-build/autotools/missing --run automake-1.11 --foreign --ignore-deps
[INFO] aclocal.m4:75: AM_PROG_AR is expanded from...
[INFO]
configure.ac:37: warning: AC_PROG_LIBTOOL was called before AM_PROG_AR
[INFO] aclocal.m4:75: AM_PROG_AR is expanded from...
[INFO] CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/aaron/workspace/hawt-jni/target/native-build/autotools/missing --run autoconf
[INFO] aclocal.m4:75: AM_PROG_AR is expanded from...
[INFO]
configure.ac:37: warning: AC_PROG_LIBTOOL was called before AM_PROG_AR
[INFO] aclocal.m4:75: AM_PROG_AR is expanded from...
[INFO] /bin/bash ./config.status --recheck
[INFO] running CONFIG_SHELL=/bin/bash /bin/bash ./configure --disable-ccache --prefix=/home/aaron/workspace/hawt-jni/target/native-build/target --no-create --no-recursion
[INFO] configure: WARNING: unrecognized options: --disable-ccache
[INFO] checking build system type... x86_64-unknown-linux-gnu
[INFO] checking host system type... x86_64-unknown-linux-gnu
[INFO] checking target system type... x86_64-unknown-linux-gnu
[INFO] checking for gcc... gcc
[INFO] checking whether the C compiler works... yes
[INFO] checking for C compiler default output file name... a.out
[INFO] checking for suffix of executables...
[INFO] checking whether we are cross compiling... no
[INFO] checking for suffix of object files... o
[INFO] checking whether we are using the GNU C compiler... yes
[INFO] checking whether gcc accepts -g... yes
[INFO] checking for gcc option to accept ISO C89... none needed
[INFO] checking for a BSD-compatible install... /usr/bin/install -c
[INFO] checking how to print strings... printf
[INFO] checking for a sed that does not truncate output... /bin/sed
[INFO] checking for grep that handles long lines and -e... /bin/grep
[INFO] checking for egrep... /bin/grep -E
[INFO] checking for fgrep... /bin/grep -F
[INFO] checking for ld used by gcc... /usr/bin/ld
[INFO] checking if the linker (/usr/bin/ld) is GNU ld... yes
[INFO] checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
[INFO] checking the name lister (/usr/bin/nm -B) interface... BSD nm
[INFO] checking whether ln -s works... yes
[INFO] checking the maximum length of command line arguments... 3458764513820540925
[INFO] checking whether the shell understands some XSI constructs... yes
[INFO] checking whether the shell understands "+="... yes
[INFO] checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
[INFO] checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
[INFO] checking for /usr/bin/ld option to reload object files... -r
[INFO] checking for objdump... objdump
[INFO] checking how to recognize dependent libraries... pass_all
[INFO] checking for dlltool... no
[INFO] checking how to associate runtime and link libraries... printf %s\n
[INFO] checking for ar... ar
[INFO] checking for archiver @FILE support... @
[INFO] checking for strip... strip
[INFO] checking for ranlib... ranlib
[INFO] checking for gawk... no
[INFO] checking for mawk... mawk
[INFO] checking command to parse /usr/bin/nm -B output from gcc object... ok
[INFO] checking for sysroot... no
[INFO] checking for mt... mt
[INFO] checking if mt is a manifest tool... no
[INFO] checking how to run the C preprocessor... gcc -E
[INFO] checking for ANSI C header files... yes
[INFO] checking for sys/types.h... yes
[INFO] checking for sys/stat.h... yes
[INFO] checking for stdlib.h... yes
[INFO] checking for string.h... yes
[INFO] checking for memory.h... yes
[INFO] checking for strings.h... yes
[INFO] checking for inttypes.h... yes
[INFO] checking for stdint.h... yes
[INFO] checking for unistd.h... yes
[INFO] checking for dlfcn.h... yes
[INFO] checking for objdir... .libs
[INFO] checking if gcc supports -fno-rtti -fno-exceptions... no
[INFO] checking for gcc option to produce PIC... -fPIC -DPIC
[INFO] checking if gcc PIC flag -fPIC -DPIC works... yes
[INFO] checking if gcc static flag -static works... yes
[INFO] checking if gcc supports -c -o file.o... yes
[INFO] checking if gcc supports -c -o file.o... (cached) yes
[INFO] checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
[INFO] checking whether -lc should be explicitly linked in... no
[INFO] checking dynamic linker characteristics... GNU/Linux ld.so
[INFO] checking how to hardcode library paths into programs... immediate
[INFO] checking whether stripping libraries is possible... yes
[INFO] checking if libtool supports shared libraries... yes
[INFO] checking whether to build shared libraries... yes
[INFO] checking whether to build static libraries... no
[INFO] checking the archiver (ar) interface... ar
[INFO] configure: javac was on your path, checking to see if it's part of a JDK we can use...
[INFO] checking if '/usr/lib/jvm/java-7-openjdk-amd64' is a JDK... yes
[INFO] checking pthread.h usability... yes
[INFO] checking pthread.h presence... yes
[INFO] checking for pthread.h... yes
[INFO] checking whether build environment is sane... yes
[INFO] checking for a thread-safe mkdir -p... /bin/mkdir -p
[INFO] checking whether make sets $(MAKE)... yes
[INFO] configure: creating ./config.status
[INFO] configure: WARNING: unrecognized options: --disable-ccache
[INFO]
[INFO] (test) version 1.0-SNAPSHOT
[INFO] Prefix.........: /home/aaron/workspace/hawt-jni/target/native-build/target
[INFO] C Compiler.....: gcc -g -O2 -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux
[INFO] Linker.........: /usr/bin/ld -m elf_x86_64 -release 1.0-SNAPSHOT
[INFO]
[INFO] /bin/bash ./config.status
[INFO] config.status: creating Makefile
[INFO] config.status: creating src/config.h
[INFO] config.status: src/config.h is unchanged
[INFO] config.status: executing libtool commands
[INFO] /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux -c -o test_structs.lo `test -f 'src/test_structs.c' || echo './'`src/test_structs.c
[INFO] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -g -O2 -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux -c src/test_structs.c -fPIC -DPIC -o .libs/test_structs.o
[INFO] src/test_structs.c:2:18: fatal error: test.h: No such file or directory
[INFO] compilation terminated.
[INFO] make: *** [test_structs.lo] Error 1
[INFO] rc: 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.714s
[INFO] Finished at: Fri May 24 06:59:47 CDT 2013
[INFO] Final Memory: 11M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.fusesource.hawtjni:maven-hawtjni-plugin:1.8:build (default) on project test: build failed: org.apache.maven.plugin.MojoExecutionException: make based build failed with exit code: 2 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles: