Skip to content

Commit

Permalink
Merge pull request #42 from KRDucky/master
Browse files Browse the repository at this point in the history
Fix Java dockermod not installing.
  • Loading branch information
revenz authored Aug 13, 2024
2 parents dc62ab4 + e43cd10 commit 70a4709
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions DockerMods/Java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Name: Java
# Description: OpenJDK is an open-source implementation of the Java Platform, Standard Edition (Java SE), providing a free and cross-platform development environment for building and running Java applications.
# Author: John Andrews
# Revision: 3
# Revision: 4
# Icon: data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4IiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUxMS45OTggNTExLjk5OCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBzdHlsZT0iZmlsbDojREIzODBFOyIgZD0iTTI1My40NjQsOTQuODY5Yy0yMy42NTgsMTYuNjM5LTUwLjQ3MSwzNS40OTgtNjQuODM4LDY2LjY5OQ0KCQljLTI0Ljk1NCw1NC40MzUsNTEuMDYyLDExMy44MTIsNTQuMzExLDExNi4zMTNjMC43NTUsMC41ODEsMS42NTksMC44NzEsMi41NiwwLjg3MWMwLjk1NywwLDEuOTE1LTAuMzI3LDIuNjkzLTAuOTc5DQoJCWMxLjUwOS0xLjI2MiwxLjkzN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tMC4zNzgtNC44MzYsMC45NTJjLTAuMTcxLDAuMTg1LTE3Ljc0LDE4LjU1Ni03MC41NjQsMjkuMzQ0DQoJCWMtMjAuMjIzLDQuMDUyLTU4LjE4Myw2LjEwNy0xMTIuODI2LDYuMTA3Yy01NC43NDUsMC0xMDYuODM4LTIuMTU0LTEwNy4zNTctMi4xNzZjLTIuMTc2LTAuMTA2LTQuMDM3LDEuNDc2LTQuMzMzLDMuNjE4DQoJCWMtMC4yOTcsMi4xNCwxLjA4Myw0LjE1OCwzLjE4NCw0LjY1OGMwLjU0MiwwLjEyOCw1NS4xMzUsMTIuOTE4LDEyOS43NzksMTIuOTE4YzM1LjgwMSwwLDcwLjYzOS0yLjkwNywxMDMuNTQ4LTguNjQ1DQoJCWM2MS4zNjEtMTAuNzU3LDY1LjY1Ny00MS4xODMsNjUuODEtNDIuNDczQzQ0MS42MzIsNDU5LjA3OCw0NDAuNjYyLDQ1Ny4zNDIsNDM5LjAxMyw0NTYuNTc4eiIvPg0KPC9nPg0KPC9zdmc+
# ----------------------------------------------------------------------------------------------------

Expand All @@ -17,34 +17,34 @@ function handle_error {
# Check if the --uninstall option is provided
if [ "$1" == "--uninstall" ]; then
echo "Uninstalling Java..."
if apt-get remove -y openjdk-22-jdk; then
if apt-get remove -y openjdk-21-jdk; then
echo "Java successfully uninstalled."
exit 0
else
handle_error
fi
fi

# Check if Java 22 is installed
if command -v java &>/dev/null && java -version 2>&1 | grep -q "22."; then
echo "Java 22 is already installed."
# Check if Java 21 is installed
if command -v java &>/dev/null && java -version 2>&1 | grep -q "21."; then
echo "Java 21 is already installed."
exit 0
fi

echo "Java 22 is not installed. Installing..."
echo "Java 21 is not installed. Installing..."

# Update package lists and install OpenJDK 22
if ! apt update || ! apt install -y openjdk-22-jdk; then
# Update package lists and install OpenJDK 21
if ! apt update || ! apt install -y openjdk-21-jdk; then
handle_error
fi

echo "Installation complete."

# Verify installation
if command -v java &>/dev/null && java -version 2>&1 | grep -q "22."; then
echo "Java 22 successfully installed."
if command -v java &>/dev/null && java -version 2>&1 | grep -q "21."; then
echo "Java 21 successfully installed."
exit 0
fi

echo "Failed to install Java 22."
echo "Failed to install Java 21."
exit 1

0 comments on commit 70a4709

Please sign in to comment.