Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFXPlugin Compile Error (Java Version)

I am trying to run some sample code from ArcGIS github here.

When I import and try to run the project in IntelliJ Community 2019 I get an error:

Cause: org/openjfx/gradle/JavaFXPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

My build.gradle:

plugins {
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.8'
}

ext {
    arcgisVersion = '100.6.0'
}

repositories {
    jcenter()
    maven {
        url 'https://esri.bintray.com/arcgis'
    }
}

configurations {
    natives
}

dependencies {
    compile "com.esri.arcgisruntime:arcgis-java:$arcgisVersion"
    natives "com.esri.arcgisruntime:arcgis-java-jnilibs:$arcgisVersion"
    natives "com.esri.arcgisruntime:arcgis-java-resources:$arcgisVersion"
}

javafx {
    version = "11.0.1"
    modules = [ 'javafx.controls' ]
}

task copyNatives(type: Copy) {
    description = "Copies the arcgis native libraries into the .arcgis directory for development."
    group = "build"
    configurations.natives.asFileTree.each {
        from(zipTree(it))
    }
    into "${System.properties.getProperty("user.home")}/.arcgis/$arcgisVersion"
}

run {
    dependsOn copyNatives
    mainClassName = 'com.mycompany.app.App'
}

wrapper {
    gradleVersion = '5.0'
}

What I have tried so far

I have downloaded Java 11 SDK and installed it. I changed the Java Version in IntelliJ to 11.

enter image description here

The error is still present even after changing to Java 11.

Update

The run configuration window does not let me select java version:

enter image description here

Similar question here - but no answer.

How do I fix this error?

like image 992
Al Grant Avatar asked Nov 14 '19 20:11

Al Grant


1 Answers

I found the answer thanks to CrazyCoder. I had to set the JDK version in Intellij in

File>Settings>Build, Execution, Deployment>Build Tools>Gradle

.

enter image description here

like image 64
Al Grant Avatar answered Nov 09 '22 22:11

Al Grant