Jasper Studio compile report issue - Unsupported class file major 61

Viewed 187

Trying to compile a Jasper Report jrxml file using Goovy language, I got an error on some files.

Eclipse version: 2022-03 Jasper Studio version: 6.19

Error message: BUG! exception in phase 'semantic analysis' in source unit 'calculator_.....' Unsupported class file major version 61

See fix in answer below.

2 Answers

Problem is due to Java 17, but not the Java installed on the computer, but the version of the Java plugin used when starting Eclipse.

To check the version used by Eclipse, open the eclipse.ini file in Eclipse folder.

Mine had:

...
-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_17.0.2.v20220201-1208/jre/bin
...

To fix it, you need to use an earlier release of Eclipse JRE.

I downloaded the version 16.0.2 full from : https://download.eclipse.org/justj/www/download.eclipse.org.php?file=jres/16/updates/release/16.0.2/plugins

Once downloaded:

  1. Copy the JAR file downloaded to /eclipse/plugins folder

  2. Unzip the jar (under eclipse/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_16.0.2.v20210721-1149 in my case)

  3. Modify the eclipse.ini accordingly:

    -vm
    plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_16.0.2.v20210721-1149/jre/bin
    

Restart Eclipse.

Note: I did save the old eclipse.ini as eclipse.ini.17 just in case I need to rollback to Java version 17.

Related