The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Classpath

Posted by Kishori Sharan on May 17, 2001 at 10:08 AM

When you run the class you need to pass the classpath settings as
c:\>java -classpath
So, when you are running your class you need to write like
c:\java\examples>java -classpath .;\c:\java\examples CreateObject

YOu are making another mistake of using CreateObject.java while running the class. When you want to run a class with java command you need topass the name of the class and not the name of the java file. Since your class is CreateObject, so you need to run it as mentioned above and not as:
java -cp -classpath CreateObject.java
Again, you need to use either -cp or -classpath. Both do the same thing.




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us