Error compiling SDK Example Perspective component with Gradle

Hi,

I downloaded the SDK Exemple and try to build the perspective component with Gradle but an error appeard: ’ java.lang.UnsupportedClassVersionError: com/inductiveautomation/gradle/IgnitionModlPlugin 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 c
lass file versions up to 52.0 '.

I tried to downgrade JDK version or update gradle version but nothing change.
I have compiled on Windows 10 with Intelij IDE.
Is there a solution ?

Thank’s

Sounds like you’re trying to build with JDK 8 instead of JDK 11.

I tried with JDK 11 but then this error is showing: 'Could not initialize class org.codehaus.groovy.runtime.InvokerHelper'.

Update: after relaunch IDE i have now :
'Execution failed for task ':web:nodeSetup'.

Could not resolve all files for configuration ':web:detachedConfiguration1'.
Could not find org.nodejs:node:8.15.0.
Searched in the following locations:
- https://nodejs.org/dist/v8.15.0/ivy.xml
Required by:
project :web

Possible solution:

Does it compile and build via the command line?

./gradlew build

I tried to build via gradlew build and gradlew buildModule, by the way the command line gradlew clean doesn't work either.
The error

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

is showing at the importation of the project on Intelij and appears when it Sync.
However, i have succesfully build it on a Windows server 2016 system (it's working perfectly), while i tried on an other Windows 10 system and it's not even building.

Is this related to a particular JAVA_HOME path or configuration on Windows server?

I don’t think you have JDK 11 set as your JDK. Check the output of java -version and the value of $JAVA_HOME.

i just seemed to have had this problem too,

Adjusting the javahome and path didnt seem to work for me manually,

But i used the scripting version on this site to easily change between java version and that worked

(had to adjust the script to be the right version (11.0.11))
and when i go to jdk version 11 it seems to works fine.
Tho it seems that somehow whenever i close my commandpromt the javaversion changes back, but with this script that is easily handled

error:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

java -version
openjdk version "14.0.2" 2020-07-14
OpenJDK Runtime Environment (build 14.0.2+12-46)
OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)


java11  ((=the adjusted script from the link))
Java 11 activated.

java -version
java version "11.0.11" 2021-04-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.11+9-LTS-194)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.11+9-LTS-194, mixed mode)


gradlew buildModule
Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details
...
BUILD SUCCESSFUL in 9m 16s
27 actionable tasks: 27 executed
C:\perspective-component>