我在Eclipse 中建立的任一project,都会出现编译环境相冲突的的error,重装jre jdk 1.4.2 都不行,
请教高手
错误如下:
Incompatible .class files version in required binaries. Project 'esmcol_mr ' is targeting a 1.1 runtime, but is compiled against 'C:j2sdk1.4.2/jre/lib/charsets.jar ' which requires a 1.4 runtime
2 Incompatible .class files version in required binaries. Project 'esmcol_mr ' is targeting a 1.1 runtime, but is compiled against 'C:j2sdk1.4.2/jre/lib/ext/dnsns.jar ' which requires a 1.4 runtime
2 Incompatible .class files version in required binaries. Project 'esmcol_mr ' is targeting a 1.1 runtime, but is compiled against 'C:j2sdk1.4.2/jre/lib/ext/ldapsec.jar ' which requires a 1.4 runtime
2 Incompatible .class files version in required binaries. Project 'esmcol_mr ' is targeting a 1.1 runtime, but is compiled against 'C:j2sdk1.4.2/jre/lib/ext/localedata.jar ' which requires a 1.4 runtime
2 Incompatible .class files version in required binaries. Project 'esmcol_mr ' is targeting a 1.1 runtime, but is compiled against 'C:j2sdk1.4.2/jre/lib/jsse.jar ' which requires a 1.2 runtime
2 Incompatible .class files version in required binaries. Project 'esmcol_mr ' is targeting a 1.1 runtime, but is compiled against 'C:j2sdk1.4.2/jre/lib/rt.jar ' which requires a 1.4 runtime
------解决方案--------------------
在环境变量中设置jdk 1.4.2 的bin 路径了??
------解决方案--------------------
可能是两个地方出现了问题:
1、是否设置了JAVA_HOME,并指向JDK 1.4.2
2、你已经正确的设置了JAVA_HOME,但仍然出现这样的问题,那么你要查看环境变量里的PATH路径,可能在PATH路径里指向了更低版本的JDK,所以在编译的时候就调用低版本的JDK了,但是也可能你的PATH路径里有两个JDK,那么你要把高版本放在低版本的前面,这样编译时就会调用高版本的JDK。
说了这么多,不知道LZ明白否
------解决方案--------------------
因为你的环境中的东西不同版本的搞混起来了,全部清除掉,重新安装一遍就好了。
------解决方案--------------------
楼上让在classpath加“.;”说的对,这个点表示当前路径。
应该是编译器和运行环境的jdk版本问题,你的系统如用用的是1.4的jdk,最好也在eclipse里面使用1.4的编译器。