Skip to content

Errors in glassfish/config/config.bat #26000

@franzl-hansel

Description

@franzl-hansel

GlassFish Version (and build number)

7.0.25 / 7.1 / 8.0

JDK version

21

OS

Windows 11

Database

No response

Problem Description

There are a couple of issues in glassfish/config/config.bat:

  1. Line 33: %AS_INTSTALL%\config should be enclosed within quotation marks, in order to handle paths containing parentheses
  2. Line 48: The semicolon in JAVA=%%~$PATH;i should be a colon

Steps to reproduce

Run the following batch script:

@echo off
set "AS_INSTALL=C:\Users\BillGates(Microsoft)\glassfish7"

if exist "%AS_INSTALL%\config\asenv.bat" (
    call "%AS_INSTALL%\config\asenv.bat"
) else (
    echo Error: asenv.bat not found in %AS_INSTALL%\config
)

for %%i in (java.exe) do set "JAVA=%%~$PATH;i"
echo %JAVA%

Whereas the following does work:

@echo off
set "AS_INSTALL=C:\Users\BillGates(Microsoft)\glassfish7"

if exist "%AS_INSTALL%\config\asenv.bat" (
    call "%AS_INSTALL%\config\asenv.bat"
) else (
    echo Error: asenv.bat not found in "%AS_INSTALL%\config"
)

for %%i in (java.exe) do set "JAVA=%%~$PATH:i"
echo %JAVA%

Impact of Issue

Requires manual correction of the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions