Sign up for our newsletter
What Is

What is Java -cp?

Java -cp is a parameter in the Java Virtual Machine or Java compiler.

The -cp, or CLASSPATH, is used as an option to the Java command. It is a parameter in the Java Virtual Machine or Java compiler that specifies the location of classes and packages which are defined by the user.

The CLASSPATH parameter can either be set via the command-line or through an environment variable.

The -cp parameter specifies a list of directories, JAR archives and ZIP archives to search for class files.

White papers from our partners

 

What is the difference between CLASSPATH and PATH?

This article is from the CBROnline archive: some formatting and images may not be present.