What is the difference between Class Path and Build Path

mehmet6parmak picture mehmet6parmak · Aug 20, 2010 · Viewed 59.1k times · Source

I'm confused with these two terms.

Also what should I do to create a file under the src folder of a Spring MVC Project? When I create using a File object it creates the file inside C:\SpringSourceTool... I guess this is ClassPath right?

How can I get the applicationcontext folder or root of the application whatever?

Answer

Andreas Dolk picture Andreas Dolk · Aug 20, 2010

The build path is used for building your application. It contains all of your source files and all Java libraries that are required to compile the application.

The classpath is used for executing the application. This includes all java classes and libraries that are needed to run the java application. A Classpath is mandatory, the default path is . which is used if the java virtual machine can't find a user defined path. (CLASSPATH environment variable, -cp flag or Class-Path: attribute in a jar manifest)