Apt UnsupportedClassVersionError

I have been trying to compile the samples that came with the jaxws-ri download but I keep getting the following error:

BUILD FAILED

C:\jaxws-ri\samples\annotations\build.xml:53: java.lang.UnsupportedClassVersionError: com/sun/tools/ws/ant/Apt (Unsupported major.minor version 49.0)

I am getting the error because I am using the wrong java version;

My JAVA_HOME is set to "C:\j2sdk1.4.2_08" but when I type "java -version" to DOS it displays:

java version"1.5.0_11"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)

Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

In C:\Program Files\Java I have the following installed:

j2re1.4.2_08

jdk1.5.0_09

jdk1.5.0_11

jre1.5.0_09

jre1.5.0_11

Why is this so? Do I have the wrong version of java?

What's going on?

I would be grateful for any replies, thank you.

[963 byte] By [fonzia] at [2007-11-27 1:52:20]
# 1
What's your CLASSPATH setting?
gymma at 2007-7-12 1:21:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

I don't have an environment variable called CLASSPATH but I have a one called PATH which contains "C:\Sun\AppServer".

Maybe I should put in the path to the JDK's in "C:\Program Files\Java\" into this variable?

Edit: do I need to upgrade the JDK I have in the C drive? (ie the one in "C:\j2sdk1.4.2_08")

The "Apt" class the compiler is complaining about was supposed to be in the "tools.jar" folder which is located in the "lib" folder of "C:\j2sdk1.4.2_08" (under "com/sun/tools/ws/ant") and also in the "lib" folders of the SDK's i have in "C:\Program Files\Java".

It wasn't there so I downloaded it and put it in there.

Is this Apt class supposed to be in "C:\j2sdk1.4.2_08" or in the the SDK's i have in "C:\Program Files\Java"?

Message was edited by:

fonzi

fonzia at 2007-7-12 1:21:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
APT requires Java SDK 5 or greater.
dkohlerta at 2007-7-12 1:21:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...