Javac [Options] [SourceFiles] [@files]: Compile a Java file.
1. Note that the execute command must be specified to the path containing the Java file, or the file error cannot be found.
2. If the JVM is not installed, the JAVAC command will not be recognized.
Simple example of a program:
A source file Hello.java, which defines a name greetings. Hello's class. The Greetings directory is the package directory for both the source and class files, and it is not the current directory. This allows us to use the default User class path. It also makes it unnecessary for us to use-The D option specifies a separate destination directory. C:>dirgreetings/C:>dir greetingshello.javac:>Cat Greetings\hello.java PackageGreetings; Public classHello { Public Static voidMain (string[] args) { for(inti=0; i < args.length; i++) {System.out.println ("Hello" +args[i]);}}} C:>javac Greetings\hello.javac:>dir Greetingshello.classHello.javac:>Java Greetings. Hello World Universe Everyonehello worldhello Universehello Everyone
Javac and Java commands execute Java programs