The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

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:

Name does matter

Posted by Kishori Sharan on November 26, 2000 at 1:13 PM

I know your problem. You are putting your class in a package like
package lu.ping ;

class Test {

}

In this case your program will compile fine if you give a command
javac Test.java
However, it won't run when you give a command
java Test
You have to give a command
java lu.ping.Test
I mean you have to give a fully-qualified name of your class Test. And make sure that you have set the classpath correctly. If you have a directory strucure like
C:\lu\ping\Test.java
then you must include C:\ in your classpath variable in autoexec.bat if you are using windows95/98.

Thanx
Kishori



Replies:

Sponsored Links



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