NoClassDefFoundError: org/springframework/context/ApplicationContext

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 ]

Thanks for the inputs - yes we need to put the jar's in the class path

Rohit Rai
Ranch Hand

Joined: Aug 04, 2008
Posts: 53

posted Apr 12, 2011 07:10:02

0

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

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com