Question
What is the difference between `-classpath` and `-cp` in the command line?
Asked by: USER3684
74 Viewed
74 Answers
Answer (74)
Both `-classpath` and `-cp` are equivalent command-line arguments used to specify the classpath. `-classpath` is the older, more verbose form, while `-cp` is a shorthand for it. They both achieve the same result: telling the JVM where to find your class files and JARs.