Today, when I was working on a project, I encountered a problem. I started it normally under tomcat in the bin directory, but an error was reported when I started it under the eclipse directory, and a strange exception was reported.
Java. Lang. unsatisfiedlinkerror: No haspjava in Java. Library. Path
Later I checked on the internet, need to download a tcnative-1.dll file, but put in the Windows/system32 directory, the result is still not good
Later, I checked the path C:/Java/jdk_1.6.2/bin directory and put it in. The result will not work as usual.
Why? Then I calmed down and thought about whether the no haspjava in Java. Library. path could not find the haspjava. dll file. Will it be wrong?
Go to the window/system32 directory and find haspjava. dll. The result is found. It may be that the path is wrong,
Then put the haspjava. dll file under C:/Java/jdk_1.6.2/bin, restart tomcat, OK, it is normal
Conclusion: directly start Tomcat and run the settings configured in the current environment variable. Starting Tomcat from eclipse will mix eclipse startup environment, so there will be some differences, the order in which eclipse is started is still in the path. Therefore, we suggest placing the JDK configuration at the beginning of the path so that it can be searched as quickly as possible.