What does the java cp option do?

603    Asked by AnushaAcharya in Java , Asked on Oct 13, 2022

java -cp FILE.jar FILE.Main inputfile 

What does the -cp option mean? For that matter, what does a negative sign in front mean? I've searched everywhere and couldn't find the answer.

Answered by Arun Singh

See this:


http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html

Quote:

-classpath classpath java cp classpath

Specifies a list of directories, JAR files, and ZIP archives to search for class files. Separate classpath entries with semicolons (;). Specifying -classpath or -cp overrides any setting of the CLASSPATH environment variable.



Your Answer

Interviews

Parent Categories