When the JDK is installed or when the JDK was previously installed, the Java file was not found or could not be loaded with Javac when the main class Com.sun.tools.javac.Main, this problem, the Internet is generally said that the environment variable configuration is wrong, this is not true, generally speaking, if your environment is properly configured to have This problem occurs most often because you will have the JRE in the process of installing the JDK
installation, if you install the JRE and JDK in the same file at this time, it will cause a conflict, the installation will delete the Javac.exe file deleted, so that the use of the Javac command error. I was for this reason for a long time did not fix this problem, finally found the reason on the Internet, generally in the installation process, choose to put the JRE and JDK into two different folders, my is in JAVA\JDK and java\jre two folders, I uninstalled the reload , installed in two different folders, once again using Javac will not have a problem ...
Javac could not find or load the main class Com.sun.tools.javac.Main