| Author |
Why cant i run like "java filename.class"
|
Bhargavan Marepalli
Greenhorn
Joined: Jun 25, 2011
Posts: 15
|
|
why cant i run a java program like java filename.class..
any reason for that???
|
 |
Ogeh Ikem
Ranch Hand
Joined: May 13, 2002
Posts: 180
|
|
The javac command expects a filename because the compiler needs to convert a file from one format to another.
The java command doesn't expect a filename; instead, it expects the fully qualified name of a class (a name that unambiguously identifies a class in a Java application); because the application launcher needs to call the main method in the class. For example, com.xyz.Test.main(args).
|
 |
Bhargavan Marepalli
Greenhorn
Joined: Jun 25, 2011
Posts: 15
|
|
Thanks dude..
|
 |
 |
|
|
subject: Why cant i run like "java filename.class"
|
|
|