h2 数据库 build.sh 返回“错误:JAVA_HOME 未定义”

问题描述 投票:0回答:0

我正在尝试在我的 Linux Debian 上安装 h2 数据库,当我运行 ./build.sh 一条消息错误返回:

Error: JAVA_HOME is not defined.
build.sh: line 17: /bin/javac: No such file or directory
build.sh: line 18: /bin/java: No such file or directory

因此,我打开了 build.script 以查找此脚本中定义的 JAVA_HOME 变量。我应该得到一些使用完整的数据

`\#!/bin/sh
if \[ -z "$JAVA_HOME" \] ; then
if \[\[ "$OSTYPE" == "darwin"\* \]\]; then
if \[ -d "/System/Library/Frameworks/JavaVM.framework/Home" \] ; then
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
else
export JAVA_HOME=`/usr/libexec/java_home`
fi
fi
fi
if \[ -z "$JAVA_HOME" \] ; then
echo "Error: JAVA_HOME is not defined."
fi
if \[ "$1" = "clean" \] ; then rm -rf temp bin ; fi
if \[ ! -d "temp" \] ; then mkdir temp ; fi
if \[ ! -d "bin" \] ; then mkdir bin ; fi
"$JAVA_HOME/bin/javac" -sourcepath src/tools -d bin src/tools/org/h2/build/\*.java
"$JAVA_HOME/bin/java" -Xmx1g -cp "bin:$JAVA_HOME/lib/tools.jar:temp" org.h2.build.Build $@`

不幸的是,我对上面写的内容几乎一无所知。为了完成我的调查,我从终端运行了以下命令:

paolo@paolo:~/java-2023-03/eclipse$ echo = $PATH
= /usr/local/netbeans-13/netbeans/java/maven/bin:/lib/jvm/jdk-17//bin:/usr/local/bin:
/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin

所以我不知道要在 build.sh 脚本中操作哪些变量.....

java bash config h2
© www.soinside.com 2019 - 2024. All rights reserved.