Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Command for running a java file

 
AKEEL MALIK
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I run a java file from the command prompt.
I compile the file by entering javac filename.java.
 
Maureen Charlton
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To compile a file at the command prompt type:

javac Example.java

to run the file at the command prompt type:

java Example

Be aware that it is case sensitive i.e. example is not the same as Example.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic