Skip to content

Commit

Permalink
dev_setup.sh: export JAVA_HOME
Browse files Browse the repository at this point in the history
  • Loading branch information
dantengsky committed Jun 16, 2022
1 parent 8b482ff commit fb252ab
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/setup/dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function install_jdk {

case "$PACKAGE_MANAGER" in
apt-get)
install_pkg openjdk-11-jre-headless "$PACKAGE_MANAGER"
install_pkg openjdk-11-jdk-headless "$PACKAGE_MANAGER"
;;
pacman)
install_pkg jre11-openjdk-headless "$PACKAGE_MANAGER"
Expand All @@ -220,6 +220,16 @@ function install_jdk {
exit 1
;;
esac

JAVA_HOME=$(readlink -f `which javac` | sed "s:/bin/javac::")

if [[ -z ${JAVA_HOME} ]];
then
echo "JAVA_HOME not found"
else
echo "set JAVA_HOME to: $JAVA_HOME"
add_to_profile "export JAVA_HOME=\"${JAVA_HOME}\""
fi
}

function install_pkg_config {
Expand Down

0 comments on commit fb252ab

Please sign in to comment.