One more "Could not determine java version from ..."

gradle -version
creates the well known error message:
Could not determine java version from ‘11.0.7’
on a debian buster.

The web is full with such error reports, there are many different reasons to get this error,
and also many solutions.
Unfortunately none of them helps me.

When i changed the java version to opernjdk8 then gradle tells me

Gradle 3.2.1

Build time:   2012-12-21 00:00:00 UTC
Revision:     none

Groovy:       2.4.16
Ant:          Apache Ant(TM) version 1.10.5 compiled on August 27 2018
JVM:          1.8.0_212 (Oracle Corporation 25.212-b03)
OS:           Linux 4.19.0-9-amd64 amd64

which gradle

sudo dpkg -S /usr/bin/gradle
gradle: /usr/bin/gradle

sudo apt show gradle | grep Version
Version: 4.4.1-6

i have already reinstalled gradle, deleted ~/.gradle and killed all gradle daemon process, but no progress.
From where does this 3.2.1 comes !?

strace -e trace=open gradle --info
Initialized native services in: /home/bschatz/.gradle/native
Removing 0 daemon stop events from registry
Previous Daemon (15192) stopped at Wed Jun 17 17:00:58 CEST 2020 after the daemon registry became unreadable
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
Starting daemon process: workingDir = /home/bschatz/.gradle/daemon/3.2.1, daemonArgs: [/usr/lib/jvm/java-8-openjdk-amd64/bin/java, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=UTF-8,, -Duser.language=de, -Duser.variant, -cp, /usr/share/gradle/lib/gradle-launcher-3.2.1.jar, org.gradle.launcher.daemon.bootstrap.GradleDaemon, 3.2.1]

ls -l /usr/share/java/gradle*3.2.1* 
-rw-r--r-- 1 root root   23708 Dez 22  2016 /usr/share/java/gradle-announce-3.2.1.jar
-rw-r--r-- 1 root root   39439 Dez 22  2016 /usr/share/java/gradle-antlr-3.2.1.jar
-rw-r--r-- 1 root root  298357 Dez 22  2016 /usr/share/java/gradle-base-services-3.2.1.jar
-rw-r--r-- 1 root root   29590 Dez 22  2016 /usr/share/java/gradle-base-services-groovy-3.2.1.jar
-rw-r--r-- 1 root root  205167 Dez 22  2016 /usr/share/java/gradle-build-comparison-3.2.1.jar
-rw-r--r-- 1 root root  146366 Dez 22  2016 /usr/share/java/gradle-build-init-3.2.1.jar

ls -l /usr/share/java/gradle*4.4.1* 
-rw-r--r-- 1 root root   23646 Jun 22  2019 /usr/share/java/gradle-announce-4.4.1.jar
-rw-r--r-- 1 root root   39535 Jun 22  2019 /usr/share/java/gradle-antlr-4.4.1.jar
-rw-r--r-- 1 root root  429931 Jun 22  2019 /usr/share/java/gradle-base-services-4.4.1.jar
-rw-r--r-- 1 root root   30107 Jun 22  2019 /usr/share/java/gradle-base-services-groovy-4.4.1.jar

Solution found ==>

sudo rm /usr/share/gradle/lib/*3.2.1*

that was to fast, now the gradle daemon starts not, probably still 3.2.1 ==>

gradle build --stacktrace
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.

* Get more help at

        at org.gradle.launcher.daemon.bootstrap.DaemonGreeter.parseDaemonOutput(
        at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startProcess(
        at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startDaemon(
        at org.gradle.launcher.daemon.client.DefaultDaemonConnector.doStartDaemon(
        at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(
        at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(
        at org.gradle.launcher.daemon.client.DaemonClient.execute(
        at org.gradle.launcher.daemon.client.DaemonClient.execute(
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
        at org.gradle.launcher.Main.doAction(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(
        at org.gradle.launcher.GradleMain.main(

It looks like you’re trying to use a version of Gradle that’s packaged by Debian. The package can differ substantially from the official distributions. e.g., support for Java 11 wasn’t added until Gradle 5.0. Even though the package installs something called “Gradle 3.2.1” or “Gradle 4.4.1”, it’s not the same as what you would download from

I would try installing Gradle from