You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2019/11/23 05:29:32 UTC

[incubator-iotdb] branch fix_win_start_script created (now 0833cc0)

This is an automated email from the ASF dual-hosted git repository.

hxd pushed a change to branch fix_win_start_script
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 0833cc0  allow using user defined JAVA_HOME and allow blank space in the JAVA_HOME

This branch includes the following new commits:

     new 0833cc0  allow using user defined JAVA_HOME and allow blank space in the JAVA_HOME

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-iotdb] 01/01: allow using user defined JAVA_HOME and allow blank space in the JAVA_HOME

Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hxd pushed a commit to branch fix_win_start_script
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 0833cc03854f6c147032a88cd04bcf5e085fcea8
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Sat Nov 23 13:28:46 2019 +0800

    allow using user defined JAVA_HOME and allow blank space in the JAVA_HOME
---
 .../src/assembly/resources/sbin/start-server.bat   | 44 +++++++++++-----------
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/server/src/assembly/resources/sbin/start-server.bat b/server/src/assembly/resources/sbin/start-server.bat
index 534bdf2..57ba10d 100755
--- a/server/src/assembly/resources/sbin/start-server.bat
+++ b/server/src/assembly/resources/sbin/start-server.bat
@@ -22,30 +22,14 @@ echo ````````````````````````
 echo Starting IoTDB
 echo ````````````````````````
 
-PATH %PATH%;%JAVA_HOME%\bin\
+
+set PATH="%JAVA_HOME%\bin\";%PATH%
 set "FULL_VERSION="
 set "MAJOR_VERSION="
 set "MINOR_VERSION="
 
-if "%OS%" == "Windows_NT" setlocal
-
-pushd %~dp0..
-if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%cd%
-popd
-
-set IOTDB_CONF=%IOTDB_HOME%\conf
-set IOTDB_LOGS=%IOTDB_HOME%\logs
-
-IF EXIST "%IOTDB_CONF%\iotdb-env.bat" (
-    CALL "%IOTDB_CONF%\iotdb-env.bat"
-    ) ELSE (
-    echo "can't find %IOTDB_CONF%\iotdb-env.bat"
-    )
-
-if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.db.service.IoTDB
-if NOT DEFINED JAVA_HOME goto :err
 
-for /f tokens^=2-5^ delims^=.-_+^" %%j in ('%JAVA_HOME%\bin\java -fullversion 2^>^&1') do (
+for /f tokens^=2-5^ delims^=.-_+^" %%j in ('java -fullversion 2^>^&1') do (
 	set "FULL_VERSION=%%j-%%k-%%l-%%m"
 	IF "%%j" == "1" (
 	    set "MAJOR_VERSION=%%k"
@@ -65,6 +49,24 @@ IF NOT %JAVA_VERSION% == 8 (
 	)
 )
 
+if "%OS%" == "Windows_NT" setlocal
+
+pushd %~dp0..
+if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%cd%
+popd
+
+set IOTDB_CONF=%IOTDB_HOME%\conf
+set IOTDB_LOGS=%IOTDB_HOME%\logs
+
+IF EXIST "%IOTDB_CONF%\iotdb-env.bat" (
+    CALL "%IOTDB_CONF%\iotdb-env.bat"
+    ) ELSE (
+    echo "can't find %IOTDB_CONF%\iotdb-env.bat"
+    )
+
+if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.db.service.IoTDB
+if NOT DEFINED JAVA_HOME goto :err
+
 @REM -----------------------------------------------------------------------------
 @REM JVM Opts we'll use in legacy run or installation
 set JAVA_OPTS=-ea^
@@ -78,7 +80,7 @@ set JAVA_OPTS=-ea^
 set CLASSPATH="%IOTDB_HOME%\lib"
 
 @REM For each jar in the IOTDB_HOME lib directory call append to build the CLASSPATH variable.
-set CLASSPATH=%CLASSPATH%;"%IOTDB_HOME%\lib\*"
+for %%i in ("%IOTDB_HOME%\lib\*.jar") do call :append "%%i"
 set CLASSPATH=%CLASSPATH%;iotdb.IoTDB
 goto okClasspath
 
@@ -104,4 +106,4 @@ pause
 
 pause
 
-ENDLOCAL
\ No newline at end of file
+ENDLOCAL