← Back to team overview

dhis2-devs team mailing list archive

Re: DHIS-lite and check for Java

 

2009/8/18 Knut Staring <knutst@xxxxxxxxx>

> Here is the current content of startup.bat for DHIS-lite:
>
> @echo off
>
> if not "%JAVA_HOME%" == "" goto startup
> :abort
> echo DHIS 2 requires a Java Runtime Environment to be installed
> pause
> goto end
> :startup
> echo Starting DHIS 2...
> java -jar dhis2-lite.jar
> goto end
> :end
>
> Unfortunately, this way of checking for Java is too assiduous, it will give
> error messages in all those common cases where people in fact have Java
> installed, but JAVA_HOME is not set (as is the case e.g. with Synergy
> machines at the WHO). We should fine a different way of detecting whether
> Java 1.6 is available.
>

True.  In fact we have no need for JAVA_HOME to be set at all.

I am not a windows batch file wizard but I'm guessing we just need to run
'java -jar dhis2-lite.jar' and catch any error which might have occurred on
the next line.

Or else try first to run something like 'java -version'  first and then
continue on the basis of that being successful.

I wonder how do other applications do it on windows?

Regards
Bob

>
> Knut
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs<https://launchpad.net/%7Edhis2-devs>
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs<https://launchpad.net/%7Edhis2-devs>
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References