相关疑难解决方法(0)

Eclipse不会编译,坏的类文件,错误的版本

我正在尝试编译从其他开发人员检出的SVN代码.Eclipse最近给我带来了很多麻烦.

以下是我的项目特定设置: 替代文字

这是我的ant文件的编译部分:

<target name="compile" depends="build-common, init" description="Compile files. ">
    <javac srcdir="${src_dir}" destdir="${build_dir}" debug="true" >
        <classpath path="${tomcat_home}/lib/servlet-api.jar;" />
    </javac>
</target>
Run Code Online (Sandbox Code Playgroud)

当我编译(使用Ant)时,我收到一条错误消息:

compile:
    [javac] Compiling 3 source files to H:\MYCOMPANY\portlets\build
    [javac] H:\MYCOMPANY\portlets\src\com\mycompany\portlets\CourseList.java:3: cannot access java.io.IOException
    [javac] bad class file: C:\Program Files\Java\jre1.6.0_07\lib\rt.jar(java/io/IOException.class)
    [javac] class file has wrong version 49.0, should be 48.0
    [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
    [javac] import java.io.IOException;
    [javac]                ^
    [javac] 1 error
Run Code Online (Sandbox Code Playgroud)

这个错误是什么意思?

java eclipse

7
推荐指数
1
解决办法
4万
查看次数

标签 统计

eclipse ×1

java ×1