简体   繁体   English

HikariDataSource上不支持的major.minor版本52.0

[英]Unsupported major.minor version 52.0 on HikariDataSource

I have Windows 7 and I am using maven to compile my codes on command line. 我有Windows 7,我正在使用maven在命令行上编译我的代码。 About 2 days ago, I had Java 6 SDK installed and that's what I was using to compile my codes. 大约2天前,我安装了Java 6 SDK,这就是我用来编译代码的东西。 Everything was working fine; 一切都很好; the compiled war file would start on its own after tcserver is launched. 编译后的war文件将在tcserver启动后自行启动。 Yesterday, due to some other issue, I had to install Java 8 SDK. 昨天,由于其他一些问题,我不得不安装Java 8 SDK。 This is when my problem started. 这是我的问题开始的时候。

It turned out that the installation of Java 8 introduced some other problem. 原来,Java 8的安装引入了一些其他问题。 So, I uninstalled Java 8 and rebooted. 所以,我卸载了Java 8并重新启动。 After that, I could still compile my codes. 在那之后,我仍然可以编译我的代码。 However, when I go to my tcserver manager and click Start on the process, I would get an error in the log file saying something about "Unsupported major.minor version 52.0". 但是,当我转到我的tcserver管理器并在进程上单击“开始”时,我会在日志文件中收到错误,说明“不支持的major.minor版本52.0”。 After some researches, it appears to be a problem with Java 8. But I did uninstall Java 8. To make sure that I have Java 6 SDK installed, I uninstalled the Java 6 SDK, re-installed it, and then re-compile my codes. 经过一些研究,它似乎是Java 8的问题。但是我确实卸载了Java 8.为了确保安装了Java 6 SDK,我卸载了Java 6 SDK,重新安装了它,然后重新编译了我的Java 6 SDK。码。 That did not help and the log still shows the same error. 这没有帮助,日志仍然显示相同的错误。

My mvn -v returns the followings, 我的mvn -v返回以下内容,

Maven home: C:\installs\maven3\apache-maven-3.1.1
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: C:\installs\Java\jdk1.6.0_45\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

My echo %JAVA_HOME% returns the followings, C:\\installs\\Java\\jdk1.6.0_45 我的echo%JAVA_HOME%返回以下内容,C:\\ installs \\ Java \\ jdk1.6.0_45

My java -version returns the followings, 我的java -version返回以下内容,

java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

From what I can see, the version of Java that is being used in compiling my codes appears to be 6. Why am I still getting that Hikari error? 从我所看到的,编译我的代码时使用的Java版本似乎是6.为什么我仍然得到Hikari错误? Where else do I need to fix to correct the problem? 我还需要修复哪些方法才能解决问题?

You should do the following steps: 您应该执行以下步骤:

  1. First delete your local maven repository (usually in /.m2/repository). 首先删除本地maven存储库(通常在/.m2/repository中)。 This would delete all installed jar-files (which may have been created with your JDK8) 这将删除所有已安装的jar文件(可能是使用JDK8创建的)
  2. call mvn clean (to clean all your files in the target directory 调用mvn clean (清除目标目录中的所有文件)
  3. Check your %JDK_HOME% (may be it points to your JDK-8 检查你的%JDK_HOME%(可能指向你的JDK-8
  4. Rebuild your project by mvn package 通过mvn package重建项目

But: 但:

1.6.0_45, vendor: Sun Microsystems Inc.

This is really bad out-dated. 这真是太糟糕了。 You should update at least to Java7. 您应该至少更新到Java7。 There are unclosed security-issues in this version. 此版本中存在未公开的安全问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM