java - Error when trying to run class file from Command Prompt -


i have class stored in c:/code/src/

i open cmd , type in

c:/code/src>java -cp . hello 

and gives me error

exception in thread "main" java.lang.noclassdeffounderror: hello <wrong name: src/hello> 

the java version "1.7._02" not know else do? complies , runs in eclipse ide not command console?

what should rectify problem?

public class hello {          public static void main(string[] args) {             system.out.println("hello");          }  } 

environment variables

java_home = c:\program files\java\jdk1.7.0_02\bin\;

path = c:\program files\java\jdk1.7.0_02\bin\;

it complies , runs in eclipse ide not command console?

you should running command in dir hello.class file
running in src has hello.java file
find hello.class file under /bin (that's eclipse places them)


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -