Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes class path error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class path error" Watch "class path error" New topic
Author

class path error

Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
I'm use below structure set class path
java -classpath c:\ddd
but displaying error below
Usage: java [-options] class [args...]
(to execute a class)
or java -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-showversion print product version and continue
-? -help print this help message
-X print help on non-standard options
how to set classpath from promt;

------------------

Senior software engineer
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
try
java -cp c:\ ddd
you must leave a space between the path and the class file.
Samith Nambiar
Ranch Hand

Joined: Mar 14, 2001
Posts: 147
hi
setting the classpath helps the java applications find the user defines classes.

By specifying java -cp/-classpath path classfile you r overiding the default classpath which is set.

If ddd is your class file then your command would be

java -cp . ddd "." specifies all the files in the current directory.

hope that helps
Samith.P.Nambiar
<pre>
\```/
(o o) harder u try luckier u get
-------oOO--(_)--OOo----------------------------
</pre>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class path error
 
Similar Threads
time,date+progress bar
java -cs AClass a b c
creating domain
help me!
Not able to Start Server