# Error compiling SDK Example Perspective component with Gradle

**URL:** <https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304>\
**Category:** Module Development\
**Created:** [May 4, 2021, 10:35am UTC](https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304 "2021-05-04T10:35:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![leo2a2b](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leo2a2b/32/26458_2.png) [@leo2a2b](https://forum.inductiveautomation.com/u/leo2a2b)\
**Post date:** [May 4, 2021, 10:35am UTC](https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304/1 "2021-05-04T10:35:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 4, 2021, 12:40pm UTC](https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304/2 "2021-05-04T12:40:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![leo2a2b](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leo2a2b/32/26458_2.png) [@leo2a2b](https://forum.inductiveautomation.com/u/leo2a2b)\
**Post date:** [May 4, 2021, 1:11pm UTC](https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304/3 "2021-05-04T13:11:37Z")

</div>

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](https://nodejs.org/dist/v8.15.0/ivy.xml)  
> Required by:  
> project :web

Possible solution:

- Declare repository providing the artifact, see the documentation at [Declaring repositories](https://docs.gradle.org/current/userguide/declaring_repositories.html)'

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 4, 2021, 1:56pm UTC](https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304/4 "2021-05-04T13:56:04Z")

</div>

Does it compile and build via the command line?

```auto
./gradlew build

```

---

<div class="post-metadata">

**Author:** ![leo2a2b](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leo2a2b/32/26458_2.png) [@leo2a2b](https://forum.inductiveautomation.com/u/leo2a2b)\
**Post date:** [May 5, 2021, 7:34am UTC](https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304/5 "2021-05-05T07:34:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 5, 2021, 1:53pm UTC](https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304/6 "2021-05-05T13:53:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 9, 2021, 8:51am UTC](https://forum.inductiveautomation.com/t/error-compiling-sdk-example-perspective-component-with-gradle/46304/7 "2021-07-09T08:51:42Z")

</div>

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

> **[How to switch Java versions in Windows (updated for JDK 16)](https://www.happycoders.eu/java/how-to-switch-multiple-java-versions-windows/)**
>
> How to install multiple Java versions on Windows simultaneously? – How to switch Java versions on the command line? (Up to JDK 16)

(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

```auto
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>

```
