Skip to content

Commit

Permalink
Merge pull request #163 from test-fullautomation/ntd1hc/bug/issue-wit…
Browse files Browse the repository at this point in the history
…h-java-installation-and-env-var

fix issue with JAVA_HOME setting, only remind user to install java
  • Loading branch information
test-fullautomation authored Oct 16, 2023
2 parents eb3d129 + 61706a6 commit 1158379
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
12 changes: 0 additions & 12 deletions config/build/dpkg_build/postinst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,6 @@ if [ -d "${DLTCONNECTOR_PATH}" ]; then
echo "sudo dpkg -i ${DLTCONNECTOR_PATH}${DLTCONNECTOR_NAME}"
fi

#
# Remind user to install OpenJDK for Java
#
###############################################################################
if ! command -v javac &> /dev/null; then
sudo apt-get update
sudo apt-get install -y default-jdk
echo -e "${MSG_DONE} default-jdk package has been installed."
else
echo -e "${MSG_INFO} OpenJDK is already installed."
fi

#
# Update robotvscode data
#
Expand Down
8 changes: 2 additions & 6 deletions config/build/dpkg_build/set_robotenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ export GENDOC_PLANTUML_PATH=$RobotVsCode/data/extensions/jebbs.plantuml-2.17.5

# Check if JAVA_HOME is already set
if [ -z "$JAVA_HOME" ]; then
# Find the path of OpenJDK using the update-alternatives command
JDK_PATH=$(update-alternatives --query javac | grep 'Value: ' | grep -o '/.*/bin/java')

JDK_PATH=$(readlink -f $(which java) 2> /dev/null) 2> /dev/null
if [ -n "$JDK_PATH" ]; then
# Export JAVA_HOME if OpenJDK path is found
export JAVA_HOME=$(dirname $(dirname $JDK_PATH))
echo "JAVA_HOME set to $JAVA_HOME"
export JAVA_HOME=$(dirname $(dirname $JDK_PATH)) 2> /dev/null
fi
fi

0 comments on commit 1158379

Please sign in to comment.