• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

NoClassDefFoundError: org/springframework/context/ApplicationContext

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have just started working on springs and have done my first "Hello World" example. It is working fine - one place that i am getting stuck with is do i need to set the spring.jar and related jar's in my classpath in order to execute it from the command line?

The sample program works fine in Eclipse - but now i have made a jar and want to execute it from the command line and i am getting the following error - i tried to set the springs.jar to the classpath but its not working - what am i missing - [this is bugging ]

C:\>java -jar rohit.jar

 
Greenhorn
Posts: 19
Mac OS X Objective C Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure you're exporting the jar correctly?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you need the Spring jars in your classpath in order for it to find Spring classes.

And it is Spring. There is no pluralization of it. It is the Spring Framework.

Mark
 
Rohit Rai
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the inputs - yes we need to put the jar's in the class path
 
Rohit Rai
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way an update on this - i was using maven for the build ... so finally i figured a way out for this . while creating the jars put in all the dependent jars - i am not too sure if it's the correct approach but since the program that i was trying to do is a standalone one i thought of using it ... in pom.xml you can use the following plugin



and create the jar using



and execute as you normally do using
 
reply
    Bookmark Topic Watch Topic
  • New Topic