AXIS error
Sorry, something seems to have gone wrong... here are the details:
Fault - Error while compiling: C:\Tomcat5\webapps\axis\WEB-INF\jwsClasses\EchoHeaders.java
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.compileError
faultSubcode:
faultString: Error while compiling: C:\Tomcat5\webapps\axis\WEB-INF\jwsClasses\EchoHeaders.java
faultActor:
faultNode:
faultDetail:
{}Errors:Error compiling C:\Tomcat5\webapps\axis\WEB-INF\jwsClasses\EchoHeaders.java:
Line 0, column 0: could not parse error message: error: Invalid class file format in C:\JDK5\lib\rt.jar(java/util/Enumeration.class). The major.minor version '49.0' is too recent for this tool to understand.
C:\Tomcat5\webapps\axis\WEB-INF\jwsClasses\EchoHeaders.java:22: Class java.util.Enumeration not found in import.
import java.util.Enumeration;
Line 0, column 0: could not parse error message: ^
error: Invalid class file format in C:\JDK5\lib\rt.jar(java/util/ArrayList.class). The major.minor version '49.0' is too recent for this tool to understand.
C:\Tomcat5\webapps\axis\WEB-INF\jwsClasses\EchoHeaders.java:23: Class java.util.ArrayList not found in import.
Line 0, column 0: could not parse error message: import java.util.ArrayList;
^
error: Invalid class file format in C:\JDK5\lib\rt.jar(java/util/Iterator.class). The major.minor version '49.0' is too recent for this tool to understand.
Line 24, column 7: Class java.util.Iterator not found in import.
Line 0, column 0: could not parse error message: error: Invalid class file format in C:\JDK5\lib\rt.jar(java/lang/Object.class). The major.minor version '49.0' is too recent for this tool to understand.
C:\Tomcat5\webapps\axis\WEB-INF\jwsClasses\EchoHeaders.java:29: Superclass java.lang.Object of class EchoHeaders not found.
public class EchoHeaders {
没学过 这是什么错.Line 0, column 0: could not parse error message: import java.util.ArrayList?
------解决方案--------------------
The major.minor version '49.0' is too recent for this tool to understand.
说明用于编译和运行java class的JDK版本不同.
在命令行下打
java -version
可以看到运行时所用的JDK的版本.
确认你的编译环境用了同样的JDK版本.
------解决方案--------------------
用二进制编辑器,如ultraedit打开java class文件,头八个字节的后面两个是这个class文件的主次版本号,如jdk1.5编译器编译出来的class文件的头八个字节是
CA FE BA BE 00 00 00 31 版本号是49.0
头四个字节是java字节码的魔数 magic number,是一种咖啡的名字 cafe babe,它表明那是个java的字节码。
如果用jdk1.5的编译器 javac,用参数 -target 1.4 可以制定编译出的目标代码能在jvm1.4下运行,也就是版本为48.0的class
CA FE BA BE 00 00 00 30