Daniel Daniel - 4 months ago 16x
Java Question

Setting the java classpath: -cp vs -classpath in JDK versions 1.0 through 1.8?

I've been looking at compiling and running Java programs from the command line and I keep seeing different versions of setting the classpath: -cp vs -classpath. I want to think these are identical but can someone more knowledgeable than me confirm or refute this?


You can easily find answer by checking official documentation. From Windows or Unix versions:

The java command has a -cp option that is an abbreviation for -classpath.