Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.loadLibrary(JudgerCore)报错 #105

Closed
LyamAL opened this issue Feb 10, 2021 · 2 comments
Closed

System.loadLibrary(JudgerCore)报错 #105

LyamAL opened this issue Feb 10, 2021 · 2 comments

Comments

@LyamAL
Copy link

LyamAL commented Feb 10, 2021

相关代码:
try {
NativeLibraryLoader.loadLibrary("JudgerCore");
} catch (Exception ex) {
//...
}

报错如下:
[DEBUG] 2021-02-10 13:17:04,247 [main] org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'runner'
java.lang.NullPointerException
at org.verwandlung.voj.judger.util.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:91)
at org.verwandlung.voj.judger.core.Runner.(Runner.java:234)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)

想问一下这个dll是根据cpp里的Judger.Core.Runner生成的吗?怎么解决0.0
牛年快乐!!感谢帮助!!

@LyamAL
Copy link
Author

LyamAL commented Feb 10, 2021

makefile后生成一个dll.
我把它放在环境变量下
报错:

java.lang.UnsatisfiedLinkError: D:\xx\JudgerCore.dll: 找不到指定的程序。

@hzxie hzxie closed this as completed Feb 10, 2021
@hzxie
Copy link
Owner

hzxie commented Feb 10, 2021

Please read README.md carefully.
不是根据PATH找的JudgerCore.dll。
正常情况下,你执行如下命令就可以。
如果不可以,请提供详细的Logs。

cd %JAVA_HOME%\include\win32
copy jawt_md.h  ..
copy jni_md.h  ..

cd judger
mvn package -DskipTests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants