The classpath is a Java terminology and buildpath is a means to construct java classpath from artifacts in elcipse like IDE's. In java world, both mean the same.
The classpath is a Java thing. It's a list of either folders or jar files to consider (in order) when resolving classes to be loaded. It's used by the Java JVM. It can be specified by the CLASSPATH environment variable or
The Eclipse build path is a means to construct this Java classpath from artifacts in the Eclipse environment. The Configure Build Path dialog is used to manipulate a file in your project called .classpath (normally hidden). This dialog allows you to form the Java classpath from Jar files, files you have built, folders, external Jar files and other things. It also controls where the Java Development Tooling (JDT) will locate your compiled files, and other things related to class files. The Eclipse help has pretty good documentation on this.
The classpath is a Java thing. It's a list of either folders or jar files to consider (in order) when resolving classes to be loaded. It's used by the Java JVM. It can be specified by the CLASSPATH environment variable or
java -classpath
. It's a list of either Jar files or folders separated by a ":" on Linux/OSX systems or ";" on Windows.The Eclipse build path is a means to construct this Java classpath from artifacts in the Eclipse environment. The Configure Build Path dialog is used to manipulate a file in your project called .classpath (normally hidden). This dialog allows you to form the Java classpath from Jar files, files you have built, folders, external Jar files and other things. It also controls where the Java Development Tooling (JDT) will locate your compiled files, and other things related to class files. The Eclipse help has pretty good documentation on this.
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. These are typically required during building the build. (mostly required even during the runtime)
Buildpath is not standard Java terminology. It is the term for the
richer way that a typical IDE specifies the relationship between the
"modules" or "projects" that make up an application. The IDE uses this
to figure out the classpath and sourcepath for compiling the Java code,
and the classpath for running it. The IDE also uses the build path to
figure out how to package up your code and its dependencies as (for
example) a WAR file.
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)
The classpath is the conventional way to tell the Java compiler and the
Java runtime where to find compiled classes. It is typically a sequence
of JAR file names and directory names. The classpath used by the
compiler and the runtime system don't have to be the same, but they typically "should be*, especially for a small project.
For example, an Eclipse build path for a project includes the other
projects that it depends on, and lists any additional library JARs that
the project contains / relies on. It also lists the packages in the
current project that downstream projects can depend on.
(If you are using Maven for your project, the IDE buildpath mechanism
is secondary to the dependencies declared in the POM files. For
example, using Eclipse with the m2eclipse, the buildpath is synthesized
from the POM files.)
No comments :
Post a Comment