本文介绍了运行mybatis生成器时发生意外错误.不支持的major.minor版本51.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行mybatis生成器配置时出现此错误.因此,当我单击generatorConfig.xml,然后单击生成Mybatis工件"时.我遇到了错误

I am getting this error while running mybatis generator configuration. So when I click on generatorConfig.xml and then click on Generate Mybatis artifacts. I am getting above error

我正在使用Java 1.7,并且已检查安装的Java版本是jdk1.7.0,jdk的编译时间也是1.7.

I am using java 1.7 and I have checked installed java version is jdk1.7.0 and jdk complie time is also 1.7.

    Unexpected error while running MyBatis Generator.
    com/mycom/myproject/db/mybatis/model/BaseModel : Unsupported major.minor version 51.0

我正在使用的表格是这样的

Tables I am using like this

  <table  tableName="feed_entries" domainObjectName="Categories" modelType="conditional">
  <property name="useActualColumnNames" value="false"/>
  <property name="rootClass" value="com.mycom.myproject.db.mybatis.model.BaseModel"/>
  <generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>

请告诉我是否还有其他要求

Please let me know if anything else is required

推荐答案

由于使用J2SE 7(51)进行编译而运行的应用程序版本较低,因此导致错误.我会说这与myBatis无关.

Error is due that you are compiling with J2SE 7 (51) but you are running you application with a lower version. I would say it has nothing to do with myBatis.

再次检查您是否正在使用J2SE 7运行代码.请查看此问题.如果通过Eclipse使用它,请确保Eclipse也使用J2SE 7.

Double check that you are running your code with J2SE 7. Take a look to this question. If you are using it though Eclipse, be sure Eclipse is using J2SE 7 also.

这篇关于运行mybatis生成器时发生意外错误.不支持的major.minor版本51.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 09:28