Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MWRAPPER-112] Detection of JAVA_HOME fails due to bad quoting
On a standard Ubuntu 20.04 Java installation (openjdk-17-jdk APT package, /usr/bin/javac linked to /usr/lib/jvm/java-17-openjdk-amd64/bin/javac via the update-alternatives system, no JAVA_HOME set), Maven Wrapper 3.2.0 prints this warning on each invocation: > Warning: JAVA_HOME environment variable is not set. This is caused by excessive quoting that adds literal double quotes to the resolution of javaHome and javaExecutable. (Some nearby invocations of "expr" use correct quoting, but several are wrong. There might have been obscure bugs and someone thought that more quoting is better. That code has been in the codebase since the beginning, taken over from the gradlew wrapper (which had the shell wrappers completely rewritten; there are no remnants of this code found there any longer).) With the literal quotes, the file system lookup fails to resolve the directory, and the auto-detection of JAVA_HOME fails, causing that warning.
- Loading branch information