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.
The error is still present even after changing to Java 11.
Update
The run configuration window does not let me select java version:
Similar question here - but no answer.
How do I fix this error?
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With