On Fri, Aug 15, 2014 at 2:30 PM, Rahkonen Jukka (Tike) <
[email protected]> wrote:

>  Hi Andrea,
>
>
>
> You have changed the script so is tests if java is installed with
>
> java –version
>
> If this test finds java you set RUN_JAVA to directory which is found with
> “where java”.
>
> if %ERRORLEVEL% GEQ 1 goto noJava
>
> for /f %%i in ('where java') do set RUN_JAVA=%%i
>
>
>
> I can see two glitches:
>
> - “where” is scanning first the default directory and then all directories
> from PATH. If several java versions exist along the path the variable
> RUN_JAVA will be overwritten and the last found directory will be used when
> the script continues. The result may be a surprise but I guess that we must
> tolerate it and perhaps mention the behaviour in RUNNING.txt.
>
>
>
> - More severe problem is that script does not find jre if the only
> installed version is 32-bit jre on 64-bit Windows.  Script tries to find
> java from the path which includes \windows\system32, but for some reason
> this directory is somehow virtual and different when command shell is
> launched in 64-bit mode or in 32-bit mode. For finding 32-bit java the
> command shell must be launched through SysWOW64 system.
>
>
>
> Here is a modified :trySystemJava that tries first to find installed
> 64-bit java and if it fails, and computer is a 64-bit one it restarts the
> script in 32-bit mode with SysWOW64 and tries to find installed 32-bit java.
>
>
>
> :trySystemJava
>
> for /f %%i in ('where java') do set RUN_JAVA=%%i
>
> rem --- we might be on amd64 having only x86 jre installed ---
>
> if "%RUN_JAVA%"=="" if DEFINED ProgramFiles(x86) if NOT
> "%PROCESSOR_ARCHITECTURE%"=="x86" (
>
>     rem --- restart the batch in x86 mode---
>
>     echo Warning: No java interpreter found in path.
>
>     echo Retry using Wow64 filesystem [32bit environment] redirection.
>
>     %SystemRoot%\SysWOW64\cmd.exe /c %0 %*
>
>     exit /b %ERRORLEVEL%
>
>   )
>
> if "RUN_JAVA%"=="" goto noJava
>
> goto checkGeoServerHome
>

Eh, I'm completely ignorant when it comes to windows batch file creation,
what I put toghether so far is based on "monkey see/monkey do"
and some internet searches.

But I guess we'll have to either be happy with it (plus your changes above)
or not do anything at all, since
it seems no windows based developer can be compelled to help on this one
(and the RC release is Monday)...

Cheers
Andrea


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to