我正在使用 hibernate 工具和 hibernate 3。JDK 版本是 1.6。然而,当我运行这个 hibernate 工具时,它默认采用 jdk 1.4,正如您在代码中看到的那样。因此我收到了这个错误。
16 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
16 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
32 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
32 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
63 [main] INFO org.hibernate.cfg.Configuration - configuring from resource:
C:\Documents and Settings\lakhan\workspace\dpppbuild\dpp_core\build.xml:332: java.lang.UnsupportedClassVersionError: com/pyyyy/pccc/dtt/core/hibernate/DppppProductMatchesPK : Unsupported major.minor version 51.0
请帮我解决这个问题。我值得注意的是如何将目标 jdk 从 1.4 更改为 1.6。我正在使用 build.xml 来执行这个 hibernate 工具。
最佳答案
它并不是默认为 jdk 1.4,而是说它正在使用“JDK 1.4 时间戳处理”。
major.minor 版本 51.0 是 JDK 7,因此您使用的 JDK 版本太低。
关于java - 使用 Hibernate 工具时出现不支持的 Major.minor 版本 51.0 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19418903/