Skip to content

dependency-check.bat does not use JAVA_HOME #8631

Description

@OrangeDog

Precondition

  • I checked the issues list for existing open or closed reports of the same problem.

Describe the bug
If java is not on the PATH then the CLI fails on Windows, even though JAVA_HOME is correctly configured.

Version of dependency-check used
The problem occurs using version 12.2.2 of the cli

Log file

java : The term 'java' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ java
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (java:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Expected behavior
The script should check, and indeed prefer, JAVA_HOME to find the java executable.

Workaround
Adjust either PATH or JAVACMD variables before calling the script.

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions