Closed tarun14110 closed 1 year ago
Hi! JDK 17 should be enough to build the project, but it seems Gradle isn't able to find yours. How did you install the JDK? You could also try running the build with --info
or --debug
to see if Gradle says anything about finding or failing to find a suitable JDK. For example something like this: ./gradlew clean run --info
on my machine prints this as the third line of output:
Received JVM installation metadata from '/usr/lib/jvm/java-17-openjdk': {JAVA_HOME=/usr/lib/jvm/java-17-openjdk, JAVA_VERSION=17.0.7, JAVA_VENDOR=N/A, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=17.0.7+7, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=17.0.7+7, VM_VENDOR=Oracle Corporation, OS_ARCH=amd64}
Hi! thanks @emlun for the quick response. I followed these commands to install jdk.
brew install openjdk@17
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc
export CPPFLAGS="-I/opt/homebrew/opt/openjdk@17/include"
Do you recommend me installing some other way? Here is my output from ./gradlew clean run --info
.
Received JVM installation metadata from '/opt/homebrew/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home': {JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home, JAVA_VERSION=17.0.7, JAVA_VENDOR=Homebrew, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=17.0.7+0, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=17.0.7+0, VM_VENDOR=Homebrew, OS_ARCH=aarch64}
Ok. We recently changed the JDK settings in the Gradle project definition, so please let me check if this is related to that: do you see the same issues if you try to build version 2.4.0
(or any earlier version)?
$ git checkout 2.4.0
$ ./gradlew run
It works fine with 2.4.0
. Appreciate your help.
Ok, I think I've found out what's going wrong. Can you try also installing JDK 11 (alongside JDK 17 or instead of it, whichever works for you) and then try to build on main
again?
The main
runs fine with JDK 11.
Ok, that's good to hear. Looks like I made some incorrect assumptions about how Gradle and GitHub Actions manage installed JDK versions. I'll revise the Gradle settings so hopefully the build can work with any JDK version no earlier than JDK 8.
For now, the conclusion is that the build requires JDK 11.
Main branch should now support building with any JDK no earlier than JDK 8. Thanks for the report!
Getting the following error while trying to build the server. I am using openjdk version "17.0.7" 2023-04-18 on MacOs Ventura 13.3.1. Any suggestions how can I fix this?
Output from
./gradlew run
Output from
./gradlew run --stacktrace