The system has recently been re-installed. All of the experience of the poisoning of the plate is painful!! After the JDK has been installed successfully, after configuring the environment variable to write a HelloWorld test there is no problem, but when you hit a container example, the following problem occurred.
problem Recurrence:
The strange thing is that I didn't have a problem with the last example. After you have determined that it is not a spelling problem, start the Baidu this cannot find or load the main class problem.
Problem Resolution steps:
1. Reconfigure the 3 environment variables in the following order:
- Java_home=d:\java
- Classpath=.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
- path=.; %java_home%\bin;
Click to open: Computer Right Button "Properties"-"Advanced system Settings"-"Advanced"-"Environment Variables"-"(System variable s) new" (if you already have this environment variable, add a semicolon in the English state, continue to write down the line)
2. Restart cmd Command Window
3. Re-enter the command (execution succeeded →→)
What system environment variables:
Environment variables (environment variables) are typically used in the operating system to specify the operating system environment of some parameters, such as: temporary folder location and System folder location.
An environment variable is an object with a specific name in the operating system that contains the information that one or more applications will use. For example, the PATH environment variable in Windows and DOS operating system, when the system is required to run a program without telling it the full path of the program, in addition to the current directory in the search for this program, but also in path specified in the path to find. The user can run the process better by setting the environment variables.
Java environment variable configuration--resolve "cannot find or load main class"