Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@ cd "${TOP}" || exit

DEFAULT_JAVA_OPTIONS=""
JAVA_VERSION=$($JAVA -version 2>&1 | awk 'NR==1{gsub(/"/,""); print $3}' | awk -F'_' '{print $1}')
# TODO: better not string number compare, use `bc` like github.com/koalaman/shellcheck/wiki/SC2072
if [[ $? -eq 0 && $JAVA_VERSION > "1.9" ]]; then
DEFAULT_JAVA_OPTIONS="--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED"

# 提取主版本号进行数值比较
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please translate them into English~

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

if [[ $JAVA_VERSION == 1.* ]]; then
MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'.' -f2)
else
MAJOR_VERSION=$(echo $JAVA_VERSION | cut -d'.' -f1)
fi

if [[ $? -eq 0 && $MAJOR_VERSION -ge 9 ]]; then
DEFAULT_JAVA_OPTIONS="--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的逻辑需要更新了, 现在是必须要求 Java 版本 == 11, 而不只是 Java9 之后了

所以麻烦修改一下这里的逻辑, 如果不符合请直接清晰的告诉用户需要使用 Java xx (这个抽取为一个变量, 方便后续升级 Java17/21 的时候直接调整即可, 避免硬编码了)

另外同时也看看 pd/store 的启动脚本里是否有版本检查, 一并可以同步一下, THX

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

fi

echo "Initializing HugeGraph Store..."
Expand Down
Loading