1, problem phenomenon
First of all, the code is absolutely free of problems.
F:\01 java\01 project\00 Connectdatabase>java operateoracle
Error: The main class operateoracle could not be found or could not be loaded
2. Solutions
This problem occurs because the path to the jar is newly added to the classpath F:\01 java\04 Libs\database-lib\ojdbc7.jar but not followed by a semicolon ";"
classpath configuration that will cause the problem :
C:\Program Files\java\jdk1.7.0_65\lib\tools.jar; F:\01 java\04 Libs\database-lib\mysql-connector-java-5.1.33-bin.jar; F:\01 java\04 Libs\database-lib\ojdbc7.jar
after adding a semicolon, the Classpath configuration that runs correctly :
C:\Program Files\java\jdk1.7.0_65\lib\tools.jar; F:\01 java\04 Libs\database-lib\mysql-connector-java-5.1.33-bin.jar; F:\01 java\04 Libs\database-lib\ojdbc7.jar;
3, Association and summary
Through this problem, the individual thinks that when all other environment variables are configured, it is advisable to add a semicolon ";" after the environment variable, so as to avoid the occurrence of the problem. Otherwise, like this, a sudden "error: unable to find or can not load the main class", and then to troubleshoot problems, it is time-consuming. That would be worth the candle. But specifically why to add a semicolon after the environment variable, this does not know what the reason, hoping to have a master pointing. Additionally, this problem can occur if the JDK's own jar file path is not configured or incorrectly configured in Classpath.