aspose file tools
The moose likes Beginning Java and the fly likes Why cant i run like Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Why cant i run like "java filename.class" " Watch "Why cant i run like "java filename.class" " New topic
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..
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Why cant i run like "java filename.class"
 
Similar Threads
Runs Only in Appletviewer
Setting Classpaths
Deploy a servlet
inbuild classes shows only filename.class why ?
Command Line