unexpected error while running mybatis generator.

2019-08-17 05:01发布

问题:

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

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

回答1:

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.

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.



标签: java mybatis