groovy

CLONE -JAVA_HOME with Backslash at end results in Error JAVA_HOME not set

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5.5, 1.6-beta-1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP Groovy 1.0-beta-6
  • Number of attachments :
    0

Description

On my system I have JAVA_HOME set to "C:\JDK\"
This results in an error message when starting GROOVY:
"JAVA_HOME not set"

When I change JAVA_HOME to "C:\JDK" everything works fine.

This can be a litte disturbing for new users and should be easy to fix, I guess.

Greetings,
Malte

Issue Links

Activity

Hide
David Trattnig added a comment -

I think it's still a problem and important, because in other cases/tools it's not obligatory to define the path without a trailing backslash. e.g. Even the GRAILS_HOME is checked for a trailing backslash.

I've done a modification of the file %GRAILS_HOME%\bin\startGrails.bat at section ":have_JAVA_HOME" I've added following:

:have_JAVA_HOME

@rem Remove trailing slash from JAVA_HOME:
if "%JAVA_HOME:~-1%"=="\" SET JAVA_HOME=%JAVA_HOME:~0,-1%

If needed I can also create a patch for Grails 1.0.2

Show
David Trattnig added a comment - I think it's still a problem and important, because in other cases/tools it's not obligatory to define the path without a trailing backslash. e.g. Even the GRAILS_HOME is checked for a trailing backslash. I've done a modification of the file %GRAILS_HOME%\bin\startGrails.bat at section ":have_JAVA_HOME" I've added following: :have_JAVA_HOME @rem Remove trailing slash from JAVA_HOME: if "%JAVA_HOME:~-1%"=="\" SET JAVA_HOME=%JAVA_HOME:~0,-1% If needed I can also create a patch for Grails 1.0.2
Hide
David Trattnig added a comment -

Note: This is a clone of http://jira.codehaus.org/browse/GROOVY-636 - cloned to reopen issue.

Show
David Trattnig added a comment - Note: This is a clone of http://jira.codehaus.org/browse/GROOVY-636 - cloned to reopen issue.
Hide
Paul King added a comment -

Added this. I am not sure what the official convention is supposed to be for JAVA_HOME but removing the trailing slash if found can't hurt. This is done just for Groovy, not Grails. You should raise an issue for Grails if you want that fixed too.

Show
Paul King added a comment - Added this. I am not sure what the official convention is supposed to be for JAVA_HOME but removing the trailing slash if found can't hurt. This is done just for Groovy, not Grails. You should raise an issue for Grails if you want that fixed too.
Hide
David Trattnig added a comment -

Great, thx!

Show
David Trattnig added a comment - Great, thx!

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: