You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Biju GC (JIRA)" <ji...@apache.org> on 2014/08/15 00:33:18 UTC

[jira] [Commented] (GERONIMO-5365) Parentheses in JAVA_HOME path prevent *.bat files from running

    [ https://issues.apache.org/jira/browse/GERONIMO-5365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14097816#comment-14097816 ] 

Biju GC commented on GERONIMO-5365:
-----------------------------------

Another solution is we should use only short file name in dos/windows batch file.
To do that we need to convert all the path used in the batch file.

I have created a dos batch file named fixjavajrehome.bat to do that for me.
I run this before running geronimo files.
This only correct JAVA_HOME and JRE_HOME now.
You can add other environment variables if you need.
Let me share that with you.

BTW, I have Apache Geronimo (3.0.1) 

=== shortname.bat === 
set %1=%~s2 

=== end of shortname.bat === 


=== fixvar.bat === 
set CURRENT_DIR_FIXVAR=%cd% 

:start 

if defined var %1 ( 

   @REM Strip quotes 
   SET FIX_PATH_VAR_VAL=%FIX_PATH_VAR_VAL:"=% 

   @REM convert long file name to short 
   call %~dps0\shortname FIX_PATH_VAR_VAL "%FIX_PATH_VAR_VAL%" 

   if exist "%FIX_PATH_VAR_VAL%" goto pathexist 
   SET JAVA_HOME= 
   goto end 

:pathexist 
   cd /d %FIX_PATH_VAR_VAL% 

   @REM gets the dir name with trailing slash striped 
   set %1=%cd% 
    
@) 

:end 

cd /d %CURRENT_DIR_FIXVAR% 

=== end of fixvar.bat === 




=== fixjavajrehome.bat === 

set FIX_PATH_VAR_VAL=%JAVA_HOME% 
call %~dps0\fixvar JAVA_HOME 

set FIX_PATH_VAR_VAL=%JRE_HOME% 
call %~dps0\fixvar JRE_HOME 

=== end of fixjavajrehome.bat === 



You can also add text from fixjavajrehome.bat in the beginning of 
"setjavaenv.bat" c:\geronimo-tomcat7-javaee6-3.0.1\bin\ 
to avoid running fixjavajrehome.bat every time.



 

> Parentheses in JAVA_HOME path prevent *.bat files from running
> --------------------------------------------------------------
>
>                 Key: GERONIMO-5365
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-5365
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 2.2
>         Environment: Microsoft Windows XP Pro + SP3, 64bit
>            Reporter: Stasa Medjedovic
>            Assignee: viola.lu
>              Labels: JAVA_HOME
>
> I have JAVA_HOME variable set as: 
> JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_17
> When I try to run any of the .bat files from Geronimo bin folder I get the following error:
> > \Java\jdk1.6.0_17\jre) was unexpected at this time.
> I tried to quote JAVA_HOME as:
> > set JAVA_HOME="C:\Program Files (x86)\Java\jdk1.6.0_17"
> and got the same error.
> Parentheses are probably the problem ...



--
This message was sent by Atlassian JIRA
(v6.2#6252)