Javac tool is the program that is used to compile Java source code into compiled classes. The java source code is written in files with extension .java. In order to execute the program, these files need to be compiled in .class files. The javac executable comes with the JDK. It can be launched from the command line with bunch of input parameters. The most important input to the tool is to specify the location of source files that needs to be compiled. These source files can depend on other project classes or other classes packaged in the jars (libs) which can be specified as classpath arguments. Once the command is executed, it will create the compiled .class files which further can be run with Java tool.
Java tool is the program that launches the JVM. The java executable comes with the JDK and is also part of JRE. It can be launched from the command line with bunch of input parameters. The main class that need to be executed, is a required parameter. This main class depends on other project classes (compiled by javac) or classes in the packaged in jars (libs) which can be specified as classpath arguments. Also various environment variables like garbage collection algorithms, heap size etc. can be specified to configure the JVM runtime.