Skip to main content
Apr 14, 2022 8:59 AM UTC
Solved

Extension Class has been compiled by a more recent version of the Java Runtime

Hello,

 

 

I am trying to make my first extension in ThingWorx 8.5. Everything seems fine but when I try to import it I have the following error:

zip4jExplorer/ZipExplorerThingTemplate has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Here are my settings for the Java compiler: 

FredDL_0-1649926426947.png

I use JavaSE-1.8 which correspond to JavaRuntime 52.0 according to the documentation

I use gradle to build the extension.

Any Idea about what I am doing wrong? 
Best regards

FredDLAnswer
Apr 21, 2022 3:17 PM UTC

So I figure it out. My problem was the jdk used by gradle, which was the default jdk used by eclipse (jdk 11) 

To change the gradle  jdk set up in Eclipse  go to Window/preference/gradle

FredDL_0-1650554227765.png

 there you can change the java home used by gradle.

 

Best regards

 

3 replies

Apr 14, 2022 11:35 AM UTC

 Hi,

 

Read the following articles:

FredDLAuthor
Apr 14, 2022 12:21 PM UTC

Hi Vladimir, 

 

thanks for your reply but the linked articles recommends to change MS-SQL driver/JDBC version. Those are not used in my thingworx extension.

The only external library is zip4j .

The error refers to the ThingTemplate Class which is reported as compiled with the non compatible 61.0 version although the java compiler compliance in Eclipse is set to 1.8 (52.0)

FredDL_0-1649938651794.png

This seems strange to me and i have no clue how to fix it.

 

 

FredDLAuthorAnswer
Apr 21, 2022 3:17 PM UTC

So I figure it out. My problem was the jdk used by gradle, which was the default jdk used by eclipse (jdk 11) 

To change the gradle  jdk set up in Eclipse  go to Window/preference/gradle

FredDL_0-1650554227765.png

 there you can change the java home used by gradle.

 

Best regards