File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
hugegraph-server/hugegraph-dist/src/assembly/static/bin Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,16 @@ cd "${TOP}" || exit
47
47
48
48
DEFAULT_JAVA_OPTIONS=" "
49
49
JAVA_VERSION=$( $JAVA -version 2>&1 | awk ' NR==1{gsub(/"/,""); print $3}' | awk -F' _' ' {print $1}' )
50
- # TODO: better not string number compare, use `bc` like github.com/koalaman/shellcheck/wiki/SC2072
51
- if [[ $? -eq 0 && $JAVA_VERSION > " 1.9" ]]; then
52
- DEFAULT_JAVA_OPTIONS=" --add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED"
50
+
51
+ # 提取主版本号进行数值比较
52
+ if [[ $JAVA_VERSION == 1.* ]]; then
53
+ MAJOR_VERSION=$( echo $JAVA_VERSION | cut -d' .' -f2)
54
+ else
55
+ MAJOR_VERSION=$( echo $JAVA_VERSION | cut -d' .' -f1)
56
+ fi
57
+
58
+ if [[ $? -eq 0 && $MAJOR_VERSION -ge 9 ]]; then
59
+ DEFAULT_JAVA_OPTIONS=" --add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED"
53
60
fi
54
61
55
62
echo " Initializing HugeGraph Store..."
You can’t perform that action at this time.
0 commit comments