Daniel Daniel - 1 year ago 100
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download