File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030![ ] ( https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg )
3131![ ] ( https://img.shields.io/badge/java--language-1.8+-blue.svg )
3232[ ![ IoTDB Website] ( https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website )] ( https://iotdb.apache.org/ )
33- [ ![ Maven Version ] ( https://maven-badges.herokuapp.com /maven-central/org.apache.iotdb/iotdb-parent/badge .svg )] ( http ://search.maven.org/#search|gav|1|g:" org.apache.iotdb" )
33+ [ ![ Maven Central ] ( https://img.shields.io /maven-central/v/ org.apache.iotdb/iotdb-parent.svg )] ( https ://central.sonatype.com/artifact/ org.apache.iotdb/iotdb-parent )
3434[ ![ Gitpod Ready-to-Code] ( https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod )] ( https://gitpod.io/#https://github.com/apache/iotdb )
3535[ ![ Slack Status] ( https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social )] ( https://join.slack.com/t/apacheiotdb/shared_invite/zt-qvso1nj8-7715TpySZtZqmyG5qXQwpg )
3636
Original file line number Diff line number Diff line change 3131![ ] ( https://img.shields.io/badge/java--language-1.8+-blue.svg )
3232[ ![ Language grade: Java] ( https://img.shields.io/lgtm/grade/java/g/apache/iotdb.svg?logo=lgtm&logoWidth=18 )] ( https://lgtm.com/projects/g/apache/iotdb/context:java )
3333[ ![ IoTDB Website] ( https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website )] ( https://iotdb.apache.org/ )
34- [ ![ Maven Version ] ( https://maven-badges.herokuapp.com /maven-central/org.apache.iotdb/iotdb-parent/badge .svg )] ( http ://search.maven.org/#search|gav|1|g:" org.apache.iotdb" )
34+ [ ![ Maven Central ] ( https://img.shields.io /maven-central/v/ org.apache.iotdb/iotdb-parent.svg )] ( https ://central.sonatype.com/artifact/ org.apache.iotdb/iotdb-parent )
3535[ ![ Slack Status] ( https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social )] ( https://join.slack.com/t/apacheiotdb/shared_invite/zt-qvso1nj8-7715TpySZtZqmyG5qXQwpg )
3636
3737# 简介
Original file line number Diff line number Diff line change @@ -115,9 +115,23 @@ if defined JAVA_HOME (
115115 set " JAVA = java"
116116)
117117
118- REM JVM options
118+ REM Detect Java major version (--add-opens only for Java 9+, see JEP 396)
119+ set " JAVA_MAJOR = "
120+ set " TEMP_VER = %TEMP% \iotdb_cli_java_ver.txt"
121+ " %JAVA% " -version 2 >& 1 | findstr /i " version" > " %TEMP_VER% "
122+ for /f " tokens=3" %%a in ('type " %TEMP_VER% " ') do for /f " tokens=1,2 delims=." %%x in (" %%~a " ) do (
123+ if " %%x " == " 1" (set " JAVA_MAJOR=%%y " ) else (set " JAVA_MAJOR=%%x " )
124+ goto :jvm_opts
125+ )
126+
127+ :jvm_opts
128+ del " %TEMP_VER% " 2 > nul
129+ REM JVM options: base options always; --add-opens only for Java 9 and above
119130set " IOTDB_CLI_PARAMS = -Dlogback.configurationFile=%IOTDB_CLI_CONF% \logback-cli.xml"
120- set " JVM_OPTS = -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8 --add-opens=java.base/java.lang=ALL-UNNAMED"
131+ set " JVM_OPTS = -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8"
132+ if not " %JAVA_MAJOR% " == " 8" if not " %JAVA_MAJOR% " == " " (
133+ set " JVM_OPTS = !JVM_OPTS! --add-opens=java.base/java.lang=ALL-UNNAMED"
134+ )
121135
122136REM Run CLI
123137" %JAVA% " %JVM_OPTS% %IOTDB_CLI_PARAMS% -cp " %CLASSPATH% " %MAIN_CLASS% %PARAMETERS%
You can’t perform that action at this time.
0 commit comments