加载pyd文件出错
// FileName: Test.java
public class Test {
static
{
System.setProperty("java.library.path", "D:\\Users\\wangxiaofei\\MYPYCHARM\\JniPy\\Test.pyd");
System.loadLibrary("Test.pyd");
}
public native void initModule();
public native void uninitModule();
public native String testFunction(String param);
}
"D:\Program Files\Java\jdk17\bin\java.exe" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.2\lib\idea_rt.jar=62779:D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.2\bin" -Dfile.encoding=UTF-8 -classpath D:\Users\AppData\IdeaProjects\demo_callpy\target\classes;D:\maven-jar\net\java\dev\jna\jna\5.9.0\jna-5.9.0.jar;D:\maven-jar\org\python\jython-standalone\2.7.0\jython-standalone-2.7.0.jar;D:\maven-jar\org\springframework\boot\spring-boot-starter-web\3.0.2\spring-boot-starter-web-3.0.2.jar;D:\maven-jar\org\springframework\boot\spring-boot-starter-json\3.0.2\spring-boot-starter-json-3.0.2.jar;D:\maven-jar\com\fasterxml\jackson\core\jackson-databind\2.14.1\jackson-databind-2.14.1.jar;D:\maven-jar\com\fasterxml\jackson\core\jackson-annotations\2.14.1\jackson-annotations-2.14.1.jar;D:\maven-jar\com\fasterxml\jackson\core\jackson-core\2.14.1\jackson-core-2.14.1.jar;D:\maven-jar\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.14.1\jackson-datatype-jdk8-2.14.1.jar;D:\maven-jar\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.14.1\jackson-datatype-jsr310-2.14.1.jar;D:\maven-jar\com\fasterxml\jackson\module\jackson-module-parameter-names\2.14.1\jackson-module-parameter-names-2.14.1.jar;D:\maven-jar\org\springframework\boot\spring-boot-starter-tomcat\3.0.2\spring-boot-starter-tomcat-3.0.2.jar;D:\maven-jar\org\apache\tomcat\embed\tomcat-embed-core\10.1.5\tomcat-embed-core-10.1.5.jar;D:\maven-jar\org\apache\tomcat\embed\tomcat-embed-el\10.1.5\tomcat-embed-el-10.1.5.jar;D:\maven-jar\org\apache\tomcat\embed\tomcat-embed-websocket\10.1.5\tomcat-embed-websocket-10.1.5.jar;D:\maven-jar\org\springframework\spring-web\6.0.4\spring-web-6.0.4.jar;D:\maven-jar\org\springframework\spring-beans\6.0.4\spring-beans-6.0.4.jar;D:\maven-jar\io\micrometer\micrometer-observation\1.10.3\micrometer-observation-1.10.3.jar;D:\maven-jar\io\micrometer\micrometer-commons\1.10.3\micrometer-commons-1.10.3.jar;D:\maven-jar\org\springframework\spring-webmvc\6.0.4\spring-webmvc-6.0.4.jar;D:\maven-jar\org\springframework\spring-aop\6.0.4\spring-aop-6.0.4.jar;D:\maven-jar\org\springframework\spring-context\6.0.4\spring-context-6.0.4.jar;D:\maven-jar\org\springframework\spring-expression\6.0.4\spring-expression-6.0.4.jar;D:\maven-jar\org\springframework\boot\spring-boot-starter\3.0.2\spring-boot-starter-3.0.2.jar;D:\maven-jar\org\springframework\boot\spring-boot\3.0.2\spring-boot-3.0.2.jar;D:\maven-jar\org\springframework\boot\spring-boot-autoconfigure\3.0.2\spring-boot-autoconfigure-3.0.2.jar;D:\maven-jar\org\springframework\boot\spring-boot-starter-logging\3.0.2\spring-boot-starter-logging-3.0.2.jar;D:\maven-jar\ch\qos\logback\logback-classic\1.4.5\logback-classic-1.4.5.jar;D:\maven-jar\ch\qos\logback\logback-core\1.4.5\logback-core-1.4.5.jar;D:\maven-jar\org\apache\logging\log4j\log4j-to-slf4j\2.19.0\log4j-to-slf4j-2.19.0.jar;D:\maven-jar\org\apache\logging\log4j\log4j-api\2.19.0\log4j-api-2.19.0.jar;D:\maven-jar\org\slf4j\jul-to-slf4j\2.0.6\jul-to-slf4j-2.0.6.jar;D:\maven-jar\jakarta\annotation\jakarta.annotation-api\2.1.1\jakarta.annotation-api-2.1.1.jar;D:\maven-jar\org\springframework\spring-core\6.0.4\spring-core-6.0.4.jar;D:\maven-jar\org\springframework\spring-jcl\6.0.4\spring-jcl-6.0.4.jar;D:\maven-jar\org\yaml\snakeyaml\1.33\snakeyaml-1.33.jar;D:\maven-jar\org\springframework\boot\spring-boot-devtools\3.0.2\spring-boot-devtools-3.0.2.jar;D:\maven-jar\org\slf4j\slf4j-api\2.0.6\slf4j-api-2.0.6.jar com.example.demo.JNITest.Demo
Exception in thread "main" java.lang.UnsatisfiedLinkError: no Test.pyd in java.library.path: D:\Program Files\Java\jdk17\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Program Files (x86)\Tools\node-v14.21.3-win-x64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Program Files (x86)\MATLAB\runtime\win64;D:\Program Files (x86)\MATLAB\bin;D:\Program Files\MATLAB\R2011a\runtime\win64;D:\Program Files\MATLAB\R2011a\bin;D:\LINGO18\;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\Azure Data Studio\bin;D:\Users\Python39\;D:\Users\Python39\Scripts\;%QUARTUS_ROOTDIR%\bin;%QUARTUS_ROOTDIR%\win;%QESS_ROOTDIR%\bin;D:\Program Files (x86)\Tools\Maven\Maven\apache-maven-3.8.6\bin;D:\Program Files (x86)\GnuWin32\bin\;D:\Program Files (x86)\mysql-5.7.41-winx64\bin;D:\Program Files (x86)\apache-tomcat-9.0.12\bin;D:\Program Files (x86)\微信web开发者工具\dll;C:\Pro;ram Files\Bandizip\;D:\Program Files (x86)\apache-tomcat-9.0.12\lib;D:\Program Files\Java\jdk17\bin;D:\Program Files (x86)\Scripts\;D:\Program Files (x86)\;C:\Users\wang'xiao'fei\AppData\Local\Microsoft\WindowsApps;D:\Program Files\JetBrains\PyCharm Community Edition 2021.3.1\bin;;D:\Program Files\Java\jdk17\bin;D:\新建文件夹\Microsoft VS Code\bin;C:\Program Files\Azure Data Studio\bin;D:\Program Files (x86)\Tools\Maven\Maven\apache-maven-3.8.6\bin;D:\Program Files (x86)\Tools\node-v14.21.3-win-x64\node_global;D:\Users\Python39;;.
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2429)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
at java.base/java.lang.System.loadLibrary(System.java:1989)
at com.example.demo.JNITest.Test.<clinit>(Test.java:9)
at com.example.demo.JNITest.Demo.main(Demo.java:7)