0

当我运行与 Jar 文件相关的 Main 类时,出现以下错误。有人请帮助我。谢谢。

D:\data\Gateway\dist>java -jar Gateway.jar com.Application
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/support/AbstractApplicationContext
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.support.AbstractApplicationContext
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        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)
        ... 6 more
4

1 回答 1

3

讯息

java.lang.NoClassDefFoundError: 
    org/springframework/context/support/AbstractApplicationContext

表示org.springframework.context必须将 jar 添加到类路径中。

于 2013-04-04T10:09:30.530 回答