I am trying to compile code checked out of SVN from another developer. Eclipse has been giving me a lot of trouble lately.
Here are my project-specific settings:

This is what the compile section of my ant file:
<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>
When I compile ( using Ant ) I get an error message:
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
What does this error mean?
The class file version of 49.0 belongs to Java 1.5.x, whereas the one of 48.0 belongs to one of the Java 1.4.x version. The classfile structure had changed in 1.5 due to the introduction of several new features and changes made in the Java Language Specification.
From the error, one can deduce that a Java 1.4 classfile was expected, whereas a Java 1.5 classfile was found. It appears that the compiler is a Java 1.4 compiler, so you should attempt to verify whether you’re using the right version of the Java compiler and also the right JDK (i.e. JDK home).
ADDENDUM
Ant tends to look for the javac executable in the $JAVA_HOME/bin/javac . If the JAVA_HOME environment variable has been set incorrectly, say to a Java 1.4 home, then there is a likelihood of getting the described error even in Eclipse.
ADDENDUM #2
The addition of entries to the PATH environment variable could result in altering the search classpath behavior of Ant, possibly resulting in a different tools.jar being used for the purpose of compiling the sources. This might be due to the jvm.dll from the JRE 1.4.2 installation being used to run Eclipse (and hence Ant).