You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2012/04/26 09:13:36 UTC

svn commit: r1330677 - /openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat

Author: andygumbrecht
Date: Thu Apr 26 07:13:35 2012
New Revision: 1330677

URL: http://svn.apache.org/viewvc?rev=1330677&view=rev
Log:
Windows service batch file tweak.

Modified:
    openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat

Modified: openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat?rev=1330677&r1=1330676&r2=1330677&view=diff
==============================================================================
--- openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat (original)
+++ openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat Thu Apr 26 07:13:35 2012
@@ -1,5 +1,6 @@
 @ECHO off
 CLS
+setlocal
 REM ================================================
 REM Licensed to the Apache Software Foundation (ASF) under one or more
 REM contributor license agreements.  See the NOTICE file distributed with
@@ -44,9 +45,20 @@ IF /i %proc% EQU undefined (
 SET jvm=auto
 REM SET JAVA_HOME=[Full path to JDK or JRE]
 
-REM Prefer a local JRE if we find one in the current directory
-IF EXIST "%~dp0jre" (
-	SET JAVA_HOME="%~dp0"
+REM Prefer a local JRE or JDK if we find one in the current or parent directory
+pushd..
+set dir=%cd%
+popd
+
+IF EXIST "%dir%\jre" (
+	SET JAVA_HOME="%dir%"
+	ECHO Found local JRE
+	GOTO found_java_home
+)
+
+IF EXIST "%dir%\jdk" (
+	SET JAVA_HOME="%dir%\jdk"
+	ECHO Found local JDK
 	GOTO found_java_home
 )