How to compile a java program


Use the following series of steps to compile a java source file.


  • Open the command prompt.


  • Go to the directory, where your java source file is stored.


  • Type javac filename.java


  • The above command creates a .class file and your java source file is compiled.


  • To run the compiled java program type java filename without .java extension.

0 comments:

Post a Comment