Java.lang.UnsatisfiedLinkError Solutions under Web Engineering __java.lang.unsatisfie

Source: Internet
Author: User

Recently in the project on JNI, encountered a very strange problem, always prompted java.lang.UnsatisfiedLinkError error. Only a partial solution was found on the Internet, and then I got it out of my way. This is explained in my method as follows:


Workaround: First put the generated dynamic link library under SRC, right-click the project name Select Build Path--> Configure builds path, change the native library in the source directory The location value is the folder location where the. dll file resides.


Condition 2: Before writing those Java code is written under Notepad, there is no build package. The eclipse operation was later used to find that only Java code could be placed under the default package to run successfully. But there's a new problem: Since jdk1.4, all classes can't invoke the class under the default package, which is a lot of trouble. I have to put these Java code in a package and run it again to prompt java.lang.UnsatisfiedLinkError errors. And then I figured, in the JNI step, "generate the. h file and then. dll ..." because the original Java file adds "package Com.jni." Again after the normal operation.


Condition 3: Write test code in Eclipse run normally, then add an adapter, change the interface, everything is OK. However, when I changed the test code to a servlet, that is, Java Engineering changed to Web engineering, again prompted Java.lang.UnsatisfiedLinkError error, the internet has not found a solution. Okay, I understand. This is because the library file is connected to a wrong location. So I searched the Xxx.dll file with everything and found that there was a. dll file underneath the project under WebApp, but build path can only edit one library location. Later, I copied the. dll file to the System32 folder, and found it miraculously good. As for why, I can only suspect that Tomcat also needs this link library.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.