简体   繁体   中英

Unsupported major.minor version 52.0 on HikariDataSource

I have Windows 7 and I am using maven to compile my codes on command line. About 2 days ago, I had Java 6 SDK installed and that's what I was using to compile my codes. Everything was working fine; the compiled war file would start on its own after tcserver is launched. Yesterday, due to some other issue, I had to install Java 8 SDK. This is when my problem started.

It turned out that the installation of Java 8 introduced some other problem. So, I uninstalled Java 8 and rebooted. 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". 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. That did not help and the log still shows the same error.

My mvn -v returns the followings,

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

My java -version returns the followings,

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? 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). This would delete all installed jar-files (which may have been created with your JDK8)
  2. call mvn clean (to clean all your files in the target directory
  3. Check your %JDK_HOME% (may be it points to your JDK-8
  4. Rebuild your project by mvn package

But:

1.6.0_45, vendor: Sun Microsystems Inc.

This is really bad out-dated. You should update at least to Java7. There are unclosed security-issues in this version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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