The -cp option to the java command
38,645
Solution 1
The example you finally gave, -cp is a parameter to the command, which is java. Parameters are generally program-specific, in this case cp stands for Class Path, which is another location java will search to find the class files as they are needed by the program.
Solution 2
See this:
Quote:
-classpath classpath -cp classpath
Specifies a list of directories, JAR files, and ZIP archives to search for class files. Separate class path entries with semicolons (;). Specifying -classpath or -cp overrides any setting of the CLASSPATH environment variable.
Related videos on Youtube
Author by
George Newton
Updated on September 18, 2022Comments
-
George Newton almost 2 years
java -cp FILE.jar FILE.Main inputfile
What does the
-cp
option mean? For that matter, what a negative sign in front mean? I've searched everywhere and couldn't find the answer.-
Admin over 10 yearsjava -cp FILE.jar FILE.Main inputfile
-
Admin over 10 yearsThen it isn't a command, it's an option to the
java
command. -
Admin over 10 yearsTry
java -h 2>&1| grep cp
.
-