2013年8月2日星期五

could not find the main class which Myeclipse can run, CMD can notrun or vice versa

 

today doing a Software Engineering program, I found a problem, and then spent some time know about it, afraid that they forget to go for a long time does not come to the garden summary memo about:

 

First, make sure not a programming problem that really does not exist main function, if you have this problem, it is not talking about this post up.

 

1, if it is possible cmd, and eclipse can not, and that is java system environment is configured correctly, while the corresponding eclipse and java environment is configured incorrectly.

 

general this case, it happens when you have modified eclipse, or multiple versions of the jdk, usually the default. This can refer to the article: http://wenku.baidu.com/view/fa749e737fd5360cba1adbdd.html There are pictures and text and write very clearly.

 

 

2, if the eclipse can be, and not cmd, java system environment that is a problem, eclipse his own version remapping generated environment.

 

such a situation, generally in accordance with a certain software, or multiple versions of the jdk, modified the system classpath, resulting in a java not identify them. By typing "java-version" to determine.

 

If you can appear on the map, then that proves no problem, if not get out, then you have to restore the java system configuration, this is the basis of java configuration.

 

 

3, the second case, if it is not resolved, it is time I encountered a problem.

 

is more shameful to say, long time useless cmd, each programming are myeclipse, this is the requirement to go through cmd also try a bit. The problem is that first compile the file, enter "javac *. Java", the second run file, enter "java ReadWord" can be, and I until the input is "java ReadWord.java" ...... Keke, but understand all the problems, but also be a learning ha ~ hehe

没有评论:

发表评论