NoClassDefFoundError Java当类路径中存在所有罚款时

时间:2017-12-05 01:51:26

标签: java noclassdeffounderror

$ ls
Dockerfile  Service1.class  Service1.java  socket.jar  tp/

$ java Service1 -jar socket.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: real/connector/view/FunctionHandler
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.privateGetMethodRecursive(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: real.connector.view.FunctionHandler
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 7 more

我把一切都放在了一边。似乎仍然得到这个错误。任何人都可以建议

1 个答案:

答案 0 :(得分:0)

设置CLASSPATH有帮助。 我将CLASSPATH设置为export CLASSPATH = / c / Users / Sufi / docker / socker.jar **:。**

我错过了:。到底。现在它的工作正常。