Issue
I am new to gradle. I am getting an warning message when using gradle build:
gradle build
Path for java installation '/usr/lib/jvm/openjdk-11' (Common Linux Locations) does not contain a java executable
BUILD SUCCESSFUL in 399ms
3 actionable tasks: 3 up-to-date
The build is successful, but is this an issue I should fix?
Some info:
usr/lib/jvm/openjdk-11 only contains a src.zip file, nothing else
'which java' returns /usr/bin/java
namei /usr/bin/java returns
f: /usr/bin/java
d /
d usr
d bin
l java -> /etc/alternatives/java
d /
d etc
d alternatives
l java -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
d /
d usr
d lib
d jvm
d java-11-openjdk-amd64
d bin
- java
echo $JAVA_HOME returns nothing
echo $PATH returns
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/opt/gradle/gradle-8.4/bin
java -version returns
openjdk version "11.0.20.1" 2023-08-24 OpenJDK Runtime Environment (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04) OpenJDK 64-Bit Server VM (build 11.0.20.1+1-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)
ChatGPT has given me a few erroneous solutions that just lead to the build failing so I won't mention those
Solution
These warnings are expected behavior in Gradle (https://github.com/gradle/gradle/issues/22921).
However, on Ubuntu (and Debian), they do not indicate an actual issue that needs fixing because a src.zip -> lib/src.zip
symlink (not an executable) is intentionally placed in /usr/lib/jvm/openjdk-11/
when Java source code is installed with sudo apt install openjdk-11-source
(https://askubuntu.com/questions/755853/how-to-install-jdk-sources).
In other words, Gradle thinks it might be a problem, but it isn't.
Answered By - tyknkd Answer Checked By - Robin (WPSolving Admin)