Skip to content

Windows CLI fails if JAVACMD contains spaces #7651

@OrangeDog

Description

@OrangeDog

Precondition

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

Describe the bug
The dependencty-check.bat script does not expand %JAVACMD% safely.

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

To Reproduce
Steps to reproduce the behavior:

set JAVACMD=C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot\bin\java.exe
dependency-check.bat

'C:\Program' is not recognized as an internal or external command, operable program or batch file.

set JAVACMD="C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot\bin\java.exe"
dependency-check.bat

Files\Eclipse was unexpected at this time.

Expected behavior
Script should successfully execute.

Additional context
Regression of #5668.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions