What is java c?
Compiling Java ProgramsThe javac command is used to invoke Java's compiler and compile a Java source file.A typical invocation of the javac command would look like below:javac [options] [source files]Both the [options] and the [source files] are optional parts of the command, and both allow multiple entries. The following are both legal javac commands:javac -helpjavac ClassName.java OneMoreClassName.javaThe first invocation doesn't compile any files, but prints a summary of valid options. The second invocation passes the compiler two .java files to compile (ClassName.java and OneMoreClassName.java). Whenever you specify multiple options and/or files they should be separated by spaces.This command would create the .class files that would be require to run the java progam.Compiling with -dBy default, the compiler puts a .class file in the same directory as the .java source file. This is fine for very small projects, but once you're working on a project of any size at all, you'll want to keep your .java files separated from your .class files. The -d option lets you tell the compiler in which directory to put the .class files it generates (d is for destination).Lets take a look at two example commands:javac -d classes source/MyTestClass.javajavac -d ../classes com/scjp/test/MyTestClass.javaExample 1 - Compile file named "MyTestClass.java" that is present inside the "source" sub-directory of the current directory and put the .class file in the "classes" sub-directory of the current directoryExample 2 - Compile the file named "MyTestClass.java" that is present in the following directory hierarchy "com/scjp/test/" from the current directory and put the .class file in the folder "classes" that is present one level above the current directoryOne thing you must know about the -d option is that if the destination directory you specify doesn't exist, you'll get a compiler error. If, in the previous example, the classes directory did NOT exist, the compiler would say something like:java:5: error while writing MyTestClass: classes/ MyTestClass.class (No such file or directory)