生产环境:
product@PisAppsv01:~/cpst/upu> java -jar /app/product/cpst/upu/itmatt/ITMATTGenerator.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
product@PisAppsv01:~/cpst/upu> java -version
java version "1.5.0_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_08-b03, mixed mode)
本机:
D:\Program Files\PowerCmd>java -version
java version "1.6.0_10-rc2"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc2-b32)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
测试环境:
production@Africa:~/cpst/upu/itmatt> java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
production@Africa:~/cpst/upu/itmatt>
解决过程:
myeclipse:
1.Window --> Preferences -->Java --> compiler中的compiler compliance level对应的下拉菜单中选择JDK版本1.5.
----not ok:Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
2.ITMATT----右键properties----Java Compiler选择1.5
----按照jdk1.5规范编译,并不需要本机安装jdk1.5;
----not ok:Exception in thread "main" java.lang.reflect.InvocationTargetException
3.ITMATT----右键properities----Run/Debug settings----JRE选择myeclipse的J2SE-1.5(jre6)
----not ok:Exception in thread "main" java.lang.reflect.InvocationTargetException
4.下载jdk1.5 64bit,本机安装,右键properties----Java Compiler选择1.5,按照下面提示,把另外几个地方也选择已安装的1.5
----程序报错,需要改程序
5.jdk1.6打jar包,生产环境使用解包方式安装jdk1.7;
cd /app/product/cpst/upu/itmatt/jdk1.7.0_03/bin
./java -jar /app/product/cpst/upu/itmatt/ITMATTGenerator.jar
----OK
阅读(2888) | 评论(0) | 转发(0) |