Search code examples
javagradlespring-bootjava-6

SpringBoot - gradle plugins for JDK1.6


I need to bring up a spring boot application with jdk1.6 as the target websphere is on 1.6. Gradle version iam using currenty is 2.10.

The plugins/dependencies I need for my project are :

  1. com.netflix.nebula:gradle-dependency-lock-plugin
  2. se.transmode.gradle:gradle-docker
  3. org.sonarsource.scanner.gradle:sonarqube-gradle-plugin

But whatever versions I tried, I am facing the " Unsupported major.minor version 51.0" error. Can someone please help me with what exact versions might help/work with jdk1.6.


Solution

  • As an alternative to finding Java 6-compatible plugins, you could build with Java 7 or 8 and produce Java 6-compatible byte code by setting sourceCompatibility and targetCompatibility to 1.6 in your build.gradle:

    sourceCompatibility = 1.6
    targetCompatibility = 1.6