Exception occurred executing command line. Cannot run program "D:\ProgramFiles\work\Java\jdk1.6\jdk1

错误信息:

Exception occurred executing command line.
Cannot run program "D:\ProgramFiles\work\Java\jdk1.6\jdk1.6.0_25\bin\javaw.exe" (in directory "D:\ProgramFiles\work\eclipse_old\workspace_test\ssm"): CreateProcess error=87, 2?êy′í

D:\ProgramFiles\work\Java\jdk1.6\jdk1.6.0_25

解决办法:

1.确保我们电脑环境变量里配置的jdk和我们项目中的jdk版本一致。

(1)查看电脑环境变量里配置的jdk版本:点击桌面左下角的“开始”——输入cmd,回车——输入java -version

Exception occurred executing command line. Cannot run program

(2)查看项目中的jdk版本:选中当前类,比如Test.java,然后鼠标右键选择Run as —— Run configurations...——选择JRE页签
Exception occurred executing command line. Cannot run program


2.选中当前类,比如Test958.java,然后鼠标右键选择Run as —— Run configurations...选择Classpath页签


3.选中User Entries 下的项目,然后Remove,最后重新Add Projects,添加时一路默认即可。


你可能感兴趣的:(java基础)