Unsupported class file major version 64

673 views
Skip to first unread message

greg travis

unread,
Aug 23, 2023, 12:26:31 AM8/23/23
to rama-user
I wonder if someone can help. I'm failing at the 'mvn gplus:shell' step from the tutorial. I've tried JDK versions oracle64-20.0.2, graalvm64-17.0.7, and graalvm64-11.0.17. Each time I ran "mvn clean ; mvn compile && mvn gplus:shell".

Is any particular Java version required for Rama?

This is on a Mac M1, Monterey 12.6.3.

Full error below.

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.rpl:rama-examples >------------------------
[INFO] Building rama-examples 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- gplus:1.13.1:shell (default-cli) @ rama-examples ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
[INFO] Using Groovy 3.0.9 to perform shell.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.648 s
[INFO] Finished at: 2023-08-23T00:24:50-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.13.1:shell (default-cli) on project rama-examples: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' Unsupported class file major version 64 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Nathan Marz

unread,
Aug 23, 2023, 12:29:50 AM8/23/23
to rama...@googlegroups.com
We've tested with OpenJDK 8, 11, and 17 (the LTS versions). Can you give one of those a shot?

--
You received this message because you are subscribed to the Google Groups "rama-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rama-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rama-user/ab2f1b4f-6c95-497e-b1bd-4f774ea81d73n%40googlegroups.com.

Nathan Marz

unread,
Aug 23, 2023, 12:37:27 AM8/23/23
to rama...@googlegroups.com
Looking again at that error, it looks like it's an issue coming from Groovy, not Rama. We've tested Rama against OpenJDK 8, 11, and 17, but I've only used the Groovy shell with Java 8. Could you try OpenJDK 8?

greg travis

unread,
Aug 23, 2023, 12:52:12 AM8/23/23
to rama-user
Hmm, I'm getting the same error with OpenJDK versions 17.0.8 and 1.8:

M:rr master$ java -version
openjdk version "1.8.0_372"
OpenJDK Runtime Environment (build 1.8.0_372-bre_2023_04_25_03_23-b00)
OpenJDK 64-Bit Server VM (build 25.372-b00, mixed mode)

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.rpl:rama-examples >------------------------
[INFO] Building rama-examples 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- gplus:1.13.1:shell (default-cli) @ rama-examples ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
[INFO] Using Groovy 3.0.9 to perform shell.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.180 s
[INFO] Finished at: 2023-08-23T00:51:30-04:00

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.13.1:shell (default-cli) on project rama-examples: Error occurred while calling a method on a Groovy class from classpath.: InvocationTargetException: BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' Unsupported class file major version 64 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Nathan Marz

unread,
Aug 23, 2023, 1:19:47 AM8/23/23
to rama...@googlegroups.com
I found a few StackOverflow links about this issue:


greg travis

unread,
Aug 28, 2023, 6:21:20 PM8/28/23
to rama-user
I'm using jenv, so JAVA_HOME isn't set at all, but invoking other java applications shows that it's runing OpenJDK 1.8.0.372.

Classfile version 64 is produced by Java 20. Is it possible that the problem is trying to use JDK 1.8 with classfiles compiled with something newer?

Is there a way to run the examples without using the Groovy shell?

greg travis

unread,
Aug 28, 2023, 6:35:11 PM8/28/23
to rama-user
Possibly answering my own question: you need a Maven plugin if you're using jenv. (Or you can hard-code JAVA_HOME, in a pinch.)

Nathan Marz

unread,
Aug 29, 2023, 12:40:01 AM8/29/23
to rama...@googlegroups.com
Rama is compiled with Java 8. If that plugin doesn't work for you, many of the examples (like HelloWorldModule) have main methods you can execute. Other examples are in static methods and you could add a main method to the code to execute them. 

The drawback to doing it this way is having to wait for the JVM to load all the classes every time you want to run an example. Another thing you could try is JShell, which was introduced in Java 9, though I haven't tried it myself so don't know how smoothly it works.

Reply all
Reply to author
Forward
0 new messages