如何设置春天的Classpath [英] How to set Spring Classpath
问题描述
我使用的IntelliJ和强制签出从svn.I工作code正在奋力奔跑的罐子。
I am using IntelliJ and jus checked out working code from the svn.I am struggling to run the jar.
它的一个简单的Java核心Spring项目。
Its a simple core java Spring project.
自从我得到上面的error.I了解,弹簧路径未设置罚款。
我该如何处理呢?
Since I get the above error.I understand that the spring path is not set fine. How do I handle it.?
private ApplicationContext appContext = new AnnotationConfigApplicationContext(ApplicationRepositoryConfiguration.class);
应用程序上下文文件是一个bean类在这里(@Bean注释使用)。我不使用XML文件。
Application context file is a bean class here (@Bean annotation is used). I am not using a xml file.
推荐答案
好像你正在运行的命令行项目。运行以下命令:
It seems like you are running your project from command line. Run following command :
Java的-classpath的spring.jar;弹簧sec.jar,......等等com.example.UrMainClass
java -classpath spring.jar;spring-sec.jar,......so on com.example.UrMainClass
而在命令中指定的jar,请确保您提供罐子完整路径。还要检查这个链接<一个href=\"http://stackoverflow.com/a/10122038/1065180\">http://stackoverflow.com/a/10122038/1065180
while specifying jar in command, make sure you provide complete path of jar. Also check this link http://stackoverflow.com/a/10122038/1065180
这篇关于如何设置春天的Classpath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!