• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why cant i run like "java filename.class"  RSS feed

 
Bhargavan Marepalli
Greenhorn
Posts: 15
Chrome Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why cant i run a java program like java filename.class..
any reason for that???
 
Ogeh Ikem
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks dude..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!