OK this is what the gradle folks told me/us:

 
https://discuss.gradle.org/t/gradle-wants-as-java-version-openjdk-11-even-if-a-newer-version-is-installed/45254/6

 Gradle itself would just use the Java from your JAVA_HOME or as
fallback from PATH (given you use a version that is compatible with
your Gradle version, otherwise it will most likely fail to execute
later on).
~
 so, the installation by apt-get should have detected that I had set
JAVA_HOME and the included the JDK in my PATH.

 In case someone stumbles on the same problems, runs into the same
thread, here are the quick steps about how to install gradle on Linux
(without gregorian chanting " ... and if you use Windows, ... and if
you use MacOS, ..."):

 1) look for the installation file at: https://gradle.org/install/

 right now:
$ date
Tue 28 Mar 2023 06:14:52 PM UTC

 it was: https://services.gradle.org/distributions/gradle-8.0.2-all.zip

 2) set the directory where you want to keep the installation file

 3) download the file to §2 using wget, curl or your browser

 4) choose an <installation directory>

 5) unzip -d "§4: which ever <installation directory> you chose" "§2:
path to the installation file <gradle-8.0.2-all.zip>"

 6) set your: PATH="<installation directory>/bin"$PATH

 7) test everything is OK:

$ which gradle
<installation directory>/bin/gradle

$ gradle --version

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

$ JAVA_HOME="<...>/GraalVM/graalvm-ce-java19-22.3.0"
PATH="${JAVA_HOME}/bin:$PATH"

which javac
javac -version

which java
java -version
<...>/GraalVM/graalvm-ce-java19-22.3.0/bin/javac
javac 19.0.1

<...>/GraalVM/graalvm-ce-java19-22.3.0/bin/java
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 19.0.1+10-jvmci-22.3-b08)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build
19.0.1+10-jvmci-22.3-b08, mixed mode, sharing)

$ gradle --version

Welcome to Gradle 8.0.2!

Here are the highlights of this release:
 - Improvements to the Kotlin DSL
 - Fine-grained parallelism from the first build with configuration cache
 - Configurable Gradle user home cache cleanup

For more details see https://docs.gradle.org/8.0.2/release-notes.html


------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          19.0.1 (GraalVM Community 19.0.1+10-jvmci-22.3-b08)
OS:           Linux 5.10.0-18-amd64 amd64

$ gradle --help

To see help contextual to the project, use gradle help

USAGE: gradle [option...] [task...]

-?, -h, --help                     Shows this help message.
...

$

Reply via email to