|
|
|
Mike, would it be possible for you to tweak our existing .bat scripts to do this path trickery and provide a patch? We're fresh out of bat/cmd experts here and I'd really like to see this fixed.
I think this is fixed. I made a dist-bin, unpacked in a directory with spaces, and was able to run. Please reopen or report a new issue if not.
I'm one of those with jruby in my program files directory (C:\Program Files\Java\JRuby). The 4830 patch breaks the launch process. The following error is reported:
'""C:\Program' is not recognized as an internal or external command, Hey Alex, can you give me specifics about your setup?
Also, can you provide your values for PATH, CLASSPATH and JAVA_HOME? I suspect you may have extra quotes in one or more of them.
Yes, I do have Java installed in Program Files I don't have JRUBY_HOME set, but I do have the path to my jruby bin in the PATH environment variable. PATH: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM;C:\ruby\bin;C:\Program Files\Java\jruby\bin;C:\Program Files\Java\jdk1.6.0_02\bin;C:\Program Files\Subversion\bin;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\Microsoft SQL Server\MSSQL\Upgrade JAVA_HOME: C:\Program Files\Java\jdk1.6.0_02 CLASSPATH (I'm not sure what these are as I haven't set any of these items myself): .;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip FIXPATH will not work in some instances though it will work in most.
The number after the tilde(~) in the short name is not always 1. I've had problems installing software and discovered "Program Files" resolving to "PROGRA~2" There is also a problem in that if the long name contains a period it and the first three characters after it are appended to the generated short name.( On checking I've discovered this is a simplification of how it works, but we end up with a 8.3 format name rather than just 8) So as the default Java installation contains the release number as part of the directory name you would need to handle this as well. For example "jdk1.6.0_03" becomes "JDK16~1.0_0" - I don't understand quite how it did that either ! Can those of you still having trouble open bugs with your specific cases? This one was resolve for the original report, but there are obviously edge cases that should be chased down separately.
|
||||||||||||||||||||||||||||||||||||||||||||
For 'modern' Windows versions (a.k.a. > NT4, does NOT work for win95/98),
the following 'weird' script commands iteratively replace directory components
in a path with the DOS 8.3 equivalent (i.e. "Program Files" is replaced with "PROGRA~1"):
A file XXX.cmd:
@REM User or Environment provides a path to JAVA_HOME
@REM clear _FIXPATH variable
set _FIXPATH=
@REM call :fixpath macro with current value of JAVA_HOME
call :fixpath "%JAVA_HOME%"
@REM re-set JAVA_HOME with results of :fixpath macro
set JAVA_HOME=%_FIXPATH:~1%
@REM invoke java program
%JAVA_HOME%\bin\java -cp ....
goto :EOF
:fixpath
if not %1.==. (
for /f "tokens=1* delims=;" %%a in (%1) do (
call :shortfilename "%%a" & call :fixpath "%%b"
)
)
goto :EOF
:shortfilename
for %%i in (%1) do set _FIXPATH=%_FIXPATH%;%%~fsi
goto :EOF