Uploaded image for project: 'Maven Wrapper'
  1. Maven Wrapper
  2. MWRAPPER-112

Detection of JAVA_HOME fails due to bad quoting

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 3.2.0, 3.3.0
    • 3.3.0
    • None
    • Ubuntu 20.04, Java 17
    • Patch

    Description

      I have 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 should detect that, but on each invocation prints this warning:

      Warning: JAVA_HOME environment variable is not set.

      This is caused by excessive quoting (i.e. the \"):

      javaExecutable="$(readlink -f "\"$javaExecutable\"")"

      Apparently, 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).

      Pull request: https://github.com/apache/maven-wrapper/pull/102

      Attachments

        Issue Links

          Activity

            People

              bmarwell Benjamin Marwell
              inkarkat Ingo Karkat
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: