File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes java -cp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java -cp" Watch "java -cp" New topic

java -cp

Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138

What does "-cp" mean in ---> java -cp abc.jar?

M K Rayapudi
Ranch Hand

Joined: Feb 19, 2007
Posts: 160
-cp means classpath for zip/jar files

java -cp abc.jar?

will look in abc.jar (of course your command is incomplete, you have to provide one more ARGUMENT i.e. an executable class name)

Steve Luke

Joined: Jan 28, 2003
Posts: 4181

It lets you set the classpath to use for searching for class files. you can also type in java -? to get help on what options are available and what they mean.

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10825

A little bit more information than the command line can be found here

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I agree. Here's the link:
subject: java -cp
It's not a secret anymore!