为什么我在Spring中遇到基本应用程序错误?
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/c
ore/io/Resource
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: org.springframework.core.io.Resourc
e
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
我在学春天。。我刚刚创建了基本的Spring应用程序
我已经使用命令提示符编写了所有类(学生模型类+测试类包含Main方法) 并创建了applicationContext。xml
# 1 楼答案
确保已将以下依赖项添加到pom中。xml文件:
# 2 楼答案
如果需要,请签入类路径 添加了弹簧芯。他似乎没有找到它
(项目属性>;Java构建路径>;库)
如果您使用Maven管理依赖项,请添加pom。xml: