Friday, November 8, 2013

How to execute Java file in command prompt


How to execute Java file in command prompt


  • Install java JDK from Oracle (any latest )
  • Open cmd Prompt ( ie ., In start >Search Box > Type "cmd"    (without quotes)
  • In Command Prompt Type   >Java -version           (You'll get the version number)
  • In Cmd prompt Type > set path=Path where Jdk is installed\bin;
Example : >set path=C:\Program Files\Java\jdk1.6.0_37\bin;
  •  Now navigate to the file structure in Command prompt where the java file is residing 
  • Type  >javac file_name.java
  • Type  >java file_name

No comments:

Post a Comment