Skip to content

Gradle 5.6.2 doesn't run with JDK 13 (release version) #10807

Closed

Description

@donhuvy

Windows 10 pro x64, JDK 13 (General Availability version), IntelliJ IDEA 2019, Spring Boot 2.1.8.RELEASE

C:\Users\donhuvy>javac --version
Picked up _JAVA_OPTIONS: -Xmx512M
javac 13-ea

C:\Users\donhuvy>java --version
Picked up _JAVA_OPTIONS: -Xmx512M
java 13-ea 2019-09-17
Java(TM) SE Runtime Environment (build 13-ea+33)
Java HotSpot(TM) 64-Bit Server VM (build 13-ea+33, mixed mode, sharing)

C:\Users\donhuvy>gradle --version
Picked up _JAVA_OPTIONS: -Xmx512M

------------------------------------------------------------
Gradle 5.6
------------------------------------------------------------

Build time:   2019-08-14 21:05:25 UTC
Revision:     f0b9d60906c7b8c42cd6c61a39ae7b74767bb012

Kotlin:       1.3.41
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          13-ea (Oracle Corporation 13-ea+33)
OS:           Windows 10 10.0 amd64

Error

Unsupported class file major version 57

Expected Behavior

Current Behavior

Context

Steps to Reproduce

Your Environment

Build scan URL:
image

Activity

  1. donhuvy commented on Sep 20, 2019

    @donhuvy
    Author

    If I use JDK 11 for Gradle run success, Related problem
    file build.gradle

    buildscript {
        ext {
            springBootVersion = '2.1.8.RELEASE'
        }
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        }
    }
    
    apply plugin: 'java'
    apply plugin: 'eclipse-wtp'
    apply plugin: 'org.springframework.boot'
    apply plugin: 'io.spring.dependency-management'
    apply plugin: 'war'
    
    group = 'com.bkit'
    version = '2019.08-SNAPSHOT'
    sourceCompatibility = 12
    
    repositories {
        mavenLocal()
        mavenCentral()
        maven {
            url 'http://jasperreports.sourceforge.net/maven2'
        }
    }
    
    configurations {
        providedRuntime
        developmentOnly
        runtimeClasspath {
            extendsFrom developmentOnly
        }
    }
    
    dependencies {
        implementation('org.springframework.boot:spring-boot-starter-actuator')
        implementation('org.springframework.boot:spring-boot-starter-data-jpa')
        implementation('org.springframework.boot:spring-boot-starter-security')
        implementation('org.springframework.boot:spring-boot-starter-web'){
            exclude module: "spring-boot-starter-tomcat"
        }
        implementation('org.springframework.boot:spring-boot-starter-thymeleaf')
        implementation('org.thymeleaf.extras:thymeleaf-extras-java8time')
        implementation('org.apache.poi:poi:4.1.0')
        implementation('org.apache.poi:poi-ooxml:4.1.0')
        implementation('org.apache.pdfbox:pdfbox:2.0.15')
        implementation('org.hibernate.validator:hibernate-validator:6.0.17.Final')
        implementation('org.glassfish:javax.el:3.0.1-b09')
        implementation('commons-beanutils:commons-beanutils:1.9.3')
        implementation('com.fasterxml.jackson.core:jackson-core:2.9.9')
        implementation('com.fasterxml.jackson.core:jackson-databind') {
            exclude module: "jackson-annotations"
        }
        developmentOnly("org.springframework.boot:spring-boot-devtools")
        providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
        implementation('net.sf.jasperreports:jasperreports:6.9.0')
        implementation('net.sf.jasperreports:jasperreports-fonts:6.9.0')
        implementation('net.sf.jasperreports:jasperreports-functions:6.9.0')
        implementation('net.sf.jasperreports:jasperreports-metadata:6.9.0')
        implementation('net.sf.jasperreports:jasperreports-fonts:6.9.0')
        implementation('net.sf.jasperreports:jasperreports-annotation-processors:6.9.0')
        implementation('net.sf.jasperreports:jasperreports-chart-themes:6.9.0')
        implementation('net.sf.jasperreports:jasperreports-chart-customizers:6.9.0')
        implementation('net.sf.jasperreports:jasperreports-custom-visualization:6.9.0')
        compile 'com.lowagie:itext:2.1.7.js5'
        implementation('ar.com.fdvs:DynamicJasper-core-fonts:2.0')
        implementation('ar.com.fdvs:DynamicJasper:5.1.2')
        
        implementation('com.itextpdf:font-asian:7.1.7')
        implementation('com.itextpdf:itext-asian:5.2.0')
    
        implementation 'com.stimulsoft:stimulsoft-reports-libs:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-demo:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-samples:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-webdesigner:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-webviewer:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-flex:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-web:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-viewer:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-report:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-base:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-lib:2019.3.3'
        implementation 'com.stimulsoft:reports:2019.3.3'
        implementation 'com.stimulsoft:stimulsoft-reports-swt:2019.2.2'
    
        implementation('org.docx4j:docx4j-core:11.1.0')
        implementation('org.docx4j:docx4j:6.1.2')
        implementation('com.j256.simplemagic:simplemagic:1.16')
        implementation('javax.xml.bind:jaxb-api:2.3.1')
        implementation('com.sun.xml.bind:jaxb-core:2.3.0.1')
        implementation('com.sun.xml.bind:jaxb-impl:2.3.1')
        implementation('javax.activation:activation:1.1.1')
        runtimeOnly('com.microsoft.sqlserver:mssql-jdbc')
        testImplementation('org.springframework.boot:spring-boot-starter-test')
    }
    

    info

    Could not target platform: 'Java SE 12' using tool chain: 'JDK 11 (11)'.
    
  2. donhuvy commented on Sep 20, 2019

    @donhuvy
    Author

    It means I cannot build to target JDK 12 if Gradle doesn't run on JDK 13.
    It means I cannot build to target JDK 13 if Gradle doesn't run on JDK 13.

  3. blindpirate commented on Sep 20, 2019

    @blindpirate
    Member

    Thanks for reporting, JDK 13 will be supported in Gradle 6.0. Closing due to duplicate of #10785

    Could not target platform: 'Java SE 12' using tool chain: 'JDK 11 (11)'.

    It's expected behavior that you can't build a higher target using lower version JDK.

  4. ljacomet commented on Sep 20, 2019

    @ljacomet
    Member

    Note that by applying the recipe described in the documentation, it is perfectly possible to use Gradle running with a lower Java version to invoke more recent java executables for compilation / test / execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:bugThis doesn't work as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions