1

I made a jni4net jar and dll file from a third party dll file. I get the error mentioned in the title section. My first question is can I use the jni4net jar file directly, just the way I work with a regular jar file? The error I am getting is when I try to make an instance by making the new file as follows:

  SslTcpClient sslTcpClient = new SslTcpClient();

thanks alot for your help.

  • You have to tell Java where to find your native libraries. Are you sure you did the necessary configuration? – mhlz Mar 03 '15 at 15:50
  • I am not entirely sure how to do this configuration. I added the file to the native library in my project then I got a file not found execption. Then move the files to the root folder, I am getting the above error. As a second question do you know why I still the the dll file although I now have a jni4net jar file? – Pejman Saberin Mar 03 '15 at 15:57

2 Answers2

1

Found the issue. Disregard your old project.create a new one and put all your .dlls and jar files inside of the root folder before the source folder. right click on the jars and add them to your build path. This includes jni4net,j.*.jar and also your *.J4N jars. In my case, although I corrected it my paths later, for some reason it stayed in memory. So YOU have to make a new project and follow the outline mentioned.

0

.Net framework version may be the problem.

This helped me;

  • First, backup your jni4net folder (you have downloaded previously as binary distribution)
  • Get the latest version of jni4net from github
  • and then try to build from source as indicated on the same link. If any problems do not mind.
  • Open visual studio and change all the framework versions of jni4net projects to the framework version you are working with
  • Now build it from visual studio. If any problems, do not mind.
  • Take all the compiled dlls/jars from their respective project folders and put it to the jni4net lib folder you have downloaded previously as binary distribution.
  • take the proxygen executable and put it to the jni4net bin folder
  • Now try to build your *.J4N.jar and *.J4N.dll (run proxygen first then execute build.cmd)

Now you have your *.J4N.jar and *.J4N.dll and you must use it with your backed up version of jni4net you have done on the first step.

myuce
  • 1,321
  • 1
  • 19
  • 29