0

I'm trying to load a .dll into my java/c++ project in eclipse. I've created the .dll in order for my Java project to use it with the JNI, but when I try to load the library, I get this message: "java.lang.UnsatisfiedLinkError: no hpaprogram in java.library.path". My main class is located in a different directory than the dll, but I used the flag -Djava.library.path=jni in VM Arguments. I have no idea what could be going wrong, and I've been debugging this for hours.

Here's my git repo: https://github.com/zalbhathena/Thesis-Test-Application

Also I'm using OS X if that matters.

EDIT: Here's a post I found. it states that I need a jnilib, not a dll. I've made the changes yet I still get the same error. I'm doing exactly what he is but in eclipse, so I'm not sure what's wrong.

zaloo
  • 879
  • 3
  • 13
  • 27

1 Answers1

0

Check if this helps: How to set the java.library.path from Eclipse

Also, maybe we can try this another way, if not already tried.

a) Create your java class having the native methods defined.

b) Use javah to generate the required header and c files (http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javah.html).

c) Put in your code in the C file generated and use gcc to create a library of the same.

Community
  • 1
  • 1
raVan
  • 296
  • 2
  • 15