About the error of jacob.dll after exe4j packages the exe file, and the solution

Don't talk nonsense, post the error message first

java.lang.UnsatisfiedLinkError: no jacob in java.library.path...

Looking at the first sentence, you know that jacob is not found in java.library.path.

Premise: I have no problem running in the project, because jacob.dll is placed under system32 and jdk/bin. But after packaging with exe4j, the above error is reported. exe4j binds its own jre (with jacob.dll).

Since jacob is not found in java.library.path, print out the path in java.library.path.

System.out.println(System.getProperty("java.library.path"));

(A class that obtains java system information is a private constructor, so its functions are static and can be called directly. The System.getProperty () function returns some system information according to the parameters. The parameters of this method can be searched online. .

However, it was found that e:java/jre7 was found first, which turned out to be a priority problem when binding jre. Although jre is specified, it is not used. What to do, move the bound jre to the front. Yes, problem solved.

 

Searched the web and found no solution to this problem. Record today for later review. My writing ability is limited, and the description of the idea of ​​solving the problem is not clear enough. Please forgive me if you see it.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326572045&siteId=291194637