theia-ide / theia-xtext

A Theia Application with DSL support through an Xtext Language Server
Apache License 2.0
29 stars 13 forks source link

UnsupportedClassVersionError for org/eclipse/core/runtime/OperationCanceledException #36

Open Anitha-y opened 2 years ago

Anitha-y commented 2 years ago

Hi,

I am getting error while performing ./gradlew shadowjar. It is not able to find the compatible versions. Tools used are gradle version 3.0, shadowjar 1.2.4 and java 8. The task io.typefox.xtext.langserver.example:generateXtextLanguage was run without any issue. However for task generateXtext it is failing with UnsupportedClassVersionError for org/eclipse/core/runtime/OperationCanceledException. It says that this class is run with Java runtime 55.0 while java 8 supports only till version 52.0.

Where is this build picking up file built with higher version of java? Am i doing something wrong in my settings?

Stacktrace: Starting a Gradle Daemon (subsequent builds will be faster) :io.typefox.xtext.langserver.example:generateXtextLanguage UP-TO-DATE :io.typefox.xtext.langserver.example:generateXtext FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

cdietrich commented 2 years ago

see https://github.com/eclipse/xtext/issues/1976

cdietrich commented 2 years ago

workaround that may work for you with older xtext and xtext-gradle-plugin versions https://github.com/itemis/xtext-languageserver-example/commit/4b6cd4607d44b92d34e9ebe235048f2c62aa4ce1

Anitha-y commented 2 years ago

Tried this. Added it into the build.gradle file under xtext-dsl-language-server. But still getting the same error. Where is this picking up the class file org/eclipse/core/runtime/OperationCanceledException from?

cdietrich commented 2 years ago

this project uses STONEAGE version of as good as everything. => you see https://github.com/eclipse/xtext/issues/1231 too => you need more constraints, update gradle and plugins => i have doubts anything of this runs with any up to date theia version

 git diff
diff --git a/xtext-dsl-language-server/build.gradle b/xtext-dsl-language-server/build.gradle
index d79f399..b8862ad 100644
--- a/xtext-dsl-language-server/build.gradle
+++ b/xtext-dsl-language-server/build.gradle
@@ -1,10 +1,11 @@
 buildscript {
        repositories {
                jcenter()
+               gradlePluginPortal()
        }
        dependencies {
-               classpath 'org.xtext:xtext-gradle-plugin:1.0.15'
-               classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
+               classpath 'org.xtext:xtext-gradle-plugin:2.1.0'
+               classpath "com.github.jengelman.gradle.plugins:shadow:5.2.0"
     }
 }

@@ -34,4 +35,12 @@ subprojects {
        configurations.all {
                exclude group: 'asm'
        }
+
+       configurations.all {
+        resolutionStrategy {
+                       force "org.eclipse.platform:org.eclipse.core.runtime:3.19.0"
+                       force "org.eclipse.platform:org.eclipse.equinox.common:3.13.0"
+        }
+    }
+
 }
diff --git a/xtext-dsl-language-server/gradle/wrapper/gradle-wrapper.properties b/xtext-dsl-language-server/gradle/wrapper/gradle-wrapper.properties
index 293fd09..4c46317 100644
--- a/xtext-dsl-language-server/gradle/wrapper/gradle-wrapper.properties
+++ b/xtext-dsl-language-server/gradle/wrapper/gradle-wrapper.properties
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip

you also need to check these workarounds for the test and for executing the plugin

is there a reason you dont simply build and deploy a vscode extension?