UnsupportedClassVersionError - JDKs have same version

前端 未结 4 1600
无人及你
无人及你 2021-01-17 06:46

I have taking an existing, old, Java code base and changed one class. I have recompiled the code base in Java 1.5.0. I then successfully deploy this code on Tomcat.

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-17 07:17

    You have compiled your class using Java 6 and deploying application with lower version i.e. Java 5. Use Java 6 run time it will fix your problem.

    “Caused by: java.lang.UnsupportedClassVersionError: (myclassname) bad major version at offset=6”

    This error indicates that your projects were compiled with a higher level Java compiler than the runtime can support.

提交回复
热议问题