![compiling java command line compiling java command line](https://i.ytimg.com/vi/N0rxN_nvYW0/maxresdefault.jpg)
That will tell the compiler using specific language features in Java 1.5 to compile the source file. For example: javac -source 1.5 MyProgram.java
![compiling java command line compiling java command line](https://i.stack.imgur.com/f9sQp.png)
We can tell the compiler which Java version applied for the source file, by using the -source release option.
![compiling java command line compiling java command line](https://i.stack.imgur.com/gVEH2.jpg)
Specify Java source compatibility version That will compile the MyProgram.java file in the src directory. For example: javac -sourcepath src MyProgram.java We can tell the compiler where to search for the source files by using the -sourcepath directoryoption.
#Compiling java command line how to#
In this Java tools tutorial, you will learn how to use the Java compiler via the javac command to compile Java source files (.java) into bytecode files (.class).