if i try to use ./gradlew bootRun i get this er...
# questions
f
if i try to use ./gradlew bootRun i get this error: BUG! exception in phase ‘semantic analysis’ in source unit ‘…/test2/Application.groovy’ Unsupported class file major version 65
j
What JDK are you using?
If you are using Java 21 with Grails 5, I expect you will run into issues. I think class file version 65 corresponds with Java 21.
f
java version 11.0.12.7.2-amzn
j
Does your project have a dependency on a library that was built with 21?
f
its a freshly made project using grails create-app test2
so it would only have dependencies from that command line
j
I don't have an idea. "Unsupported class file major version 65" is surprising. I am sorry that I can't help.
f
hurm maybe even tho i told sdk man to use java 11 it is still using java 21
j
what does
java --version
show you?
I don't think that a default created Grails 5 app would contain any dependencies on classes built with Java 21.
f
trying again with a fresh command. i was switching — right now it says 11 but perhaps before it was 21 when i ran the create-app command
j
At create-app time I don't think it would have mattered.
f
yah naw
same issue
j
I just now created a new app using Grails 5.3.6 and Java 21. At
./gradlew bootRun
time I get "Unsupported class file major version 65".
f
i. just tried with run-app in cli as the doc says
trying bootRun now
j
bootRun is a gradle task. run-app is a grails task.
f
yah both were failing
the docs for 5 don’t go over bootRun
err at least not in the create an app section
j
I am sorry that I can’t help. The error you see makes sense to me if you are using Java 21 and does not make sense to me if you are not. Good luck!
f
./gradlew bootRun
Task :bootRun
Error occurred during initialization of VM Initial heap size set to a larger value than the maximum heap size Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
java --version openjdk 11.0.12 2021-07-20 LTS OpenJDK Runtime Environment Corretto-11.0.12.7.2 (build 11.0.12+7-LTS)
yah its weird
grails --version | Grails Version: 5.3.6 | JVM Version: 11.0.12
j
It looks like you may be using Gradle 8, which is also surprising. I think the default
gradlew
for Grails 5.3.6 uses 7.2.
Your situation is a haunted mystery to me. I hope it gets sorted out.
f
even this gradlew -v comamnd says its right?
same project
./gradlew -v ------------------------------------------------------------ Gradle 7.2 ------------------------------------------------------------ Build time: 2021-08-17 095903 UTC Revision: a773786b58bb28710e3dc96c4d1a7063628952ad Kotlin: 1.5.21 Groovy: 3.0.8 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 11.0.12 (Amazon.com Inc. 11.0.12+7-LTS) OS: Mac OS X 15.2 x86_64
maybe i’ll try a different java 11 version
That is consistent with what I expect.
You might look at your GRAILS_OPTS, GRADLE_OPTS, and JAVA_OPTS to see if anything surprising appears in any of those.
partygrails 1
f
oh yes maybe so
i bet that is it
yes that was it, did not even consider it
is it because in the bootRun block there is the jvmArgs ?
which then conflict with the flags like -Xms3g -Xmx3g
in GRAILS_OPTS?
thanks @jeffscottbrown
👍 1