Using idea 2019.1.14 IC to build Idea plugin, report class file has wrong version 55.0, should be 52.0

Hi

Trying to build our plugin using IC on JDK 1.8 results in the following failure:

bad class file: /Users/yinglin/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/LATEST-EAP-SNAPSHOT/30340d8b3592bf42c2fc4ffca6466f78a6353737/ideaIC-LATEST-EAP-SNAPSHOT/lib/platform-api.jar(com/intellij/openapi/actionSystem/AnAction.class)
class file has wrong version 55.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.

And I had to build on java 8, how can I deal with it?

java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)

 

build.gradle:

plugins {
id 'java'
id 'org.jetbrains.intellij' version '1.0'
id 'org.jetbrains.kotlin.jvm' version '1.4.32'
}

apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.intellij'

group 'com.lake.json2dart'
version '1.0.3'

sourceCompatibility = 1.8

repositories {
mavenCentral()
}

ext.kotlin_version = '1.4.32'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.google.code.gson:gson:2.8.7'
implementation 'com.fifesoft:rsyntaxtextarea:3.1.3'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'

implementation 'com.kenai.nbpwr:org-jdesktop-swingx:1.6-201002261215'
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version '2019.1.4'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
patchPluginXml {
changeNotes = """xxxxxxxx
"""
}

test {
useJUnitPlatform()
}
0
Avatar
Permanently deleted user

55 indicates its a Java 11 class file you need the jar `platform-api.jar` compiled with an older version of Java. How did you get gradle to download that file originally? I too was trying to build a 2019 plugin and mine is failing because bintray does not exist anymore, my buildscript looks like this, and it fails to download the needed plugin-api.jar

 

buildscript {
repositories {
maven { url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "org.jetbrains.intellij.plugins:gradle-intellij-plugin:0.2.0-SNAPSHOT"
}
}
0

请先登录再写评论。