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

报错,Exception in thread "main" java.lang.ExceptionInInitializerError。 #41

Closed
Crystron39 opened this issue Oct 14, 2022 · 6 comments

Comments

@Crystron39
Copy link

没学过java帮不上啥忙,网上找到的内容看不懂()
拜托大佬看一下
提示内容:
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.ctfcracktools.json.PluginsJson.isJson(PluginsJson.kt:70)
at org.ctfcracktools.json.PluginsJson.(PluginsJson.kt:15)
at org.ctfcracktools.ui.DecodePanel.(DecodePanel.java:292)
at org.ctfcracktools.ui.MainUi.initComponents(MainUi.java:41)
at org.ctfcracktools.ui.MainUi.(MainUi.java:24)
at org.ctfcracktools.Main.main(Main.java:24)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @59690aa4
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:200)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:194)
at org.python.core.PyJavaType.init(PyJavaType.java:475)
at org.python.core.PyType$Registry.createType(PyType.java:477)
at org.python.core.PyType$Registry.addFromClass(PyType.java:426)
at org.python.core.PyType$Registry.resolveType(PyType.java:352)
at org.python.core.PyType$Registry$1.computeValue(PyType.java:208)
at org.python.core.PyType$Registry$1.computeValue(PyType.java:202)
at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:228)
at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:210)
at java.base/java.lang.ClassValue.get(ClassValue.java:116)
at org.python.core.PyType.fromClass(PyType.java:2137)
at org.python.core.PyObject.(PyObject.java:85)
at org.python.core.PyJavaPackage.(PyJavaPackage.java:36)
at org.python.core.PyJavaPackage.(PyJavaPackage.java:33)
at org.python.core.packagecache.PackageManager.(PackageManager.java:30)
at org.python.core.packagecache.CachedJarsPackageManager.(CachedJarsPackageManager.java:45)
at org.python.core.packagecache.PathPackageManager.(PathPackageManager.java:30)
at org.python.core.packagecache.SysPackageManager.(SysPackageManager.java:57)
at org.python.core.PySystemState.initPackages(PySystemState.java:1288)
at org.python.core.PySystemState.doInitialize(PySystemState.java:1213)
at org.python.core.PySystemState.initialize(PySystemState.java:1130)
at org.python.core.PySystemState.initialize(PySystemState.java:1085)
at org.python.core.PySystemState.initialize(PySystemState.java:1080)
at org.python.util.PythonInterpreter.initialize(PythonInterpreter.java:63)
at org.ctfcracktools.fuction.PythonFunc.jythonLoad(PythonFunc.kt:30)
at org.ctfcracktools.fuction.PythonFunc.(PythonFunc.kt:16)
at org.ctfcracktools.Config.(Config.java:23)
... 6 more

@0Chencc
Copy link
Owner

0Chencc commented Oct 14, 2022

方便贴一下您的java版本吗

@Crystron39
Copy link
Author

方便贴一下您的java版本吗

openjdk version "18.0.2.1" 2022-08-18
OpenJDK Runtime Environment (build 18.0.2.1+1-1)
OpenJDK 64-Bit Server VM (build 18.0.2.1+1-1, mixed mode, sharing)

麻烦您了

@Crystron39
Copy link
Author

方便贴一下您的java版本吗

非常抱歉,这段时间没看消息

@Crystron39
Copy link
Author

试了一下,4.0.3是可以用的,后面的版本就用不了了

@0Chencc
Copy link
Owner

0Chencc commented Nov 16, 2022

定位到问题了,下个版本修复

@0Chencc
Copy link
Owner

0Chencc commented Nov 16, 2022

是由于插件模块需要java.lang这个包的反射APi调用权限,具体参考了how-to-solve-inaccessibleobjectexception这个讨论
可以尝试使用以下命令执行本程序

java -jar CTFCrackTools-4.0.6.jar --add-opens java.base/java.lang=ALL-UNNAMED

不过奇怪的是我在mac下使用11并没有遇到这个问题,我后续思考一下如何更好的解决这个问题

@0Chencc 0Chencc closed this as completed Nov 16, 2022
0Chencc added a commit that referenced this issue Nov 16, 2022
close #38 #40 #41
该版本以及后续版本插件功能不再是强制启动的功能
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