javaclasspathbuildpath

What is the difference between Class Path and Build Path


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?


Solution

  • 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)