[Solved] JNI make error 2

Hello,

I’m trying to use JNI but I can’t manage to get it working. I’m following this little tutorial, but I’m stuck at the ‘Generating C/C++ Header File’. When I try to build using the makefile, I get an error in Eclipse. I have tried googling but couldn’t find anything useful (except for some vague ‘fixing program’ (link)).

The only information Eclipse gives me is this:

Description Resource Path Location Type
make: *** [HelloJNI.h] Error 2 HelloJNI C/C++ Problem
recipe for target ‘HelloJNI.h’ failed makefile /HelloJNI/jni line 9 C/C++ Problem

Anyone has experience with JNI and knows how to fix this / how I should do it instead? ???

I’m sure Eclipse CDT has more to say on the error in the “Console” view (just step through all open consoles to see the one responsible for the build output).
Besides that, you can try to execute your Makefile directly on the command line with the mingw32-make tool (under /bin) and see what error (if any) will be printed by it (make sure you add the /bin folder to PATH before).

Thanks KaiHH, after a long day of trial and error you forget to check ALL consoles :emo:. The ‘javah’ command is not recognised by the OS and I have replaced it with an absolute path to the JDK. It is working now. (Maybe it’s time to stop and go for a sleep? :persecutioncomplex:)