Commit c2e906e7 authored by xiezhi's avatar xiezhi

更换源

parent 86eca4ca
......@@ -2,7 +2,7 @@
"name": "Java Development Environment",
"image": "hb.eazytec-cloud.com/eazytec/eazydevelop-base:ubuntu",
"features": {
"https://gitlab.eazytec-cloud.com/eazydevelop-devcontainer-temp/devcontainer-features/java:feature_java_1.6.3_eazytec": {
"./java": {
"version": "17",
"installMaven": true,
"installGradle": true,
......
## License
For the Java Feature from this repository, see [NOTICE.txt](https://github.com/devcontainers/features/tree/main/src/java/NOTICE.txt) for licensing information on JDK distributions.
## OS Support
Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the `apt`, `yum`, `dnf`, or `microdnf` package manager installed.
`bash` is required to execute the `install.sh` script.
This source diff could not be displayed because it is too large. You can view the blob instead.
# Java (via SDKMAN!) (java)
Installs Java, SDKMAN! (if not installed), and needed dependencies.
## Example Usage
```json
"features": {
"ghcr.io/devcontainers/features/java:1": {}
}
```
## Options
| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| version | Select or enter a Java version to install | string | latest |
| additionalVersions | Enter additional Java versions, separated by commas. | string | - |
| jdkDistro | Select or enter a JDK distribution | string | ms |
| installGradle | Install Gradle, a build automation tool for multi-language software development | boolean | false |
| gradleVersion | Select or enter a Gradle version | string | latest |
| installMaven | Install Maven, a management tool for Java | boolean | false |
| mavenVersion | Select or enter a Maven version | string | latest |
| installAnt | Install Ant, a software tool for automating software build processes | boolean | false |
| antVersion | Select or enter an Ant version | string | latest |
| installGroovy | Install Groovy, powerful, optionally typed and dynamic language with static-typing and static compilation capabilities | boolean | false |
| groovyVersion | Select or enter a Groovy version | string | latest |
## Customizations
### VS Code Extensions
- `vscjava.vscode-java-pack`
## License
For the Java Feature from this repository, see [NOTICE.txt](https://github.com/devcontainers/features/tree/main/src/java/NOTICE.txt) for licensing information on JDK distributions.
## OS Support
Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the `apt`, `yum`, `dnf`, or `microdnf` package manager installed.
`bash` is required to execute the `install.sh` script.
---
_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/devcontainers/features/blob/main/src/java/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
{
"id": "java",
"version": "1.6.3",
"name": "Java (via SDKMAN!)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/java",
"description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.",
"options": {
"version": {
"type": "string",
"proposals": [
"latest",
"none",
"21",
"17",
"11",
"8"
],
"default": "latest",
"description": "Select or enter a Java version to install"
},
"additionalVersions": {
"type": "string",
"default": "",
"description": "Enter additional Java versions, separated by commas."
},
"jdkDistro": {
"type": "string",
"proposals": [
"ms",
"open",
"oracle",
"tem",
"amzn"
],
"default": "ms",
"description": "Select or enter a JDK distribution"
},
"installGradle": {
"type": "boolean",
"default": false,
"description": "Install Gradle, a build automation tool for multi-language software development"
},
"gradleVersion": {
"type": "string",
"proposals": [
"latest",
"7.5.1",
"6.9.3",
"5.6.4"
],
"default": "latest",
"description": "Select or enter a Gradle version"
},
"installMaven": {
"type": "boolean",
"default": false,
"description": "Install Maven, a management tool for Java"
},
"mavenVersion": {
"type": "string",
"proposals": [
"latest",
"3.8.6",
"3.6.3",
"3.5.4"
],
"default": "latest",
"description": "Select or enter a Maven version"
},
"installAnt": {
"type": "boolean",
"default": false,
"description": "Install Ant, a software tool for automating software build processes"
},
"antVersion": {
"type": "string",
"proposals": [
"latest",
"1.10.12",
"1.9.15"
],
"default": "latest",
"description": "Select or enter an Ant version"
},
"installGroovy": {
"type": "boolean",
"default": false,
"description": "Install Groovy, powerful, optionally typed and dynamic language with static-typing and static compilation capabilities"
},
"groovyVersion": {
"type": "string",
"proposals": [
"latest",
"2.5.22",
"3.0.19",
"4.0.16"
],
"default": "latest",
"description": "Select or enter a Groovy version"
},
"useChineseMirror": {
"type": "boolean",
"default": true,
"description": "Use Chinese mirrors (Aliyun) for faster download in China"
},
"mirrorSource": {
"type": "string",
"proposals": [
"aliyun",
"tencent",
"huawei",
"official"
],
"default": "aliyun",
"description": "Select mirror source for SDKMAN downloads"
}
},
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack"
],
"settings": {
"java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current"
}
}
},
"containerEnv": {
"SDKMAN_DIR": "/usr/local/sdkman",
"JAVA_HOME": "/usr/local/sdkman/candidates/java/current",
"PATH": "/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:${PATH}"
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
\ No newline at end of file
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/java.md
# Maintainer: The VS Code and Codespaces Teams
#
# Syntax: ./java-debian.sh [JDK version] [SDKMAN_DIR] [non-root user] [Add to rc files flag]
JAVA_VERSION="${VERSION:-"latest"}"
INSTALL_GRADLE="${INSTALLGRADLE:-"false"}"
GRADLE_VERSION="${GRADLEVERSION:-"latest"}"
INSTALL_MAVEN="${INSTALLMAVEN:-"false"}"
MAVEN_VERSION="${MAVENVERSION:-"latest"}"
INSTALL_ANT="${INSTALLANT:-"false"}"
ANT_VERSION="${ANTVERSION:-"latest"}"
INSTALL_GROOVY="${INSTALLGROOVY:-"false"}"
GROOVY_VERSION="${GROOVYVERSION:-"latest"}"
JDK_DISTRO="${JDKDISTRO:-"ms"}"
USE_CHINESE_MIRROR="${USECHINESEMIRROR:-"true"}"
MIRROR_SOURCE="${MIRRORSOURCE:-"aliyun"}"
export SDKMAN_DIR="${SDKMAN_DIR:-"/usr/local/sdkman"}"
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
UPDATE_RC="${UPDATE_RC:-"true"}"
# Comma-separated list of java versions to be installed
# alongside JAVA_VERSION, but not set as default.
ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-""}"
set -e
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi
# Bring in ID, ID_LIKE, VERSION_ID, VERSION_CODENAME
. /etc/os-release
# Get an adjusted ID independent of distro variants
MAJOR_VERSION_ID=$(echo ${VERSION_ID} | cut -d . -f 1)
if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then
ADJUSTED_ID="debian"
elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then
ADJUSTED_ID="rhel"
if [[ "${ID}" = "rhel" ]] || [[ "${ID}" = *"alma"* ]] || [[ "${ID}" = *"rocky"* ]]; then
VERSION_CODENAME="rhel${MAJOR_VERSION_ID}"
else
VERSION_CODENAME="${ID}${MAJOR_VERSION_ID}"
fi
else
echo "Linux distro ${ID} not supported."
exit 1
fi
# Setup INSTALL_CMD & PKG_MGR_CMD
if type apt-get > /dev/null 2>&1; then
PKG_MGR_CMD=apt-get
INSTALL_CMD="${PKG_MGR_CMD} -y install --no-install-recommends"
elif type microdnf > /dev/null 2>&1; then
PKG_MGR_CMD=microdnf
INSTALL_CMD="${PKG_MGR_CMD} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0"
elif type dnf > /dev/null 2>&1; then
PKG_MGR_CMD=dnf
INSTALL_CMD="${PKG_MGR_CMD} -y install"
elif type yum > /dev/null 2>&1; then
PKG_MGR_CMD=yum
INSTALL_CMD="${PKG_MGR_CMD} -y install"
else
echo "(Error) Unable to find a supported package manager."
exit 1
fi
pkg_manager_update() {
case $ADJUSTED_ID in
debian)
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
${PKG_MGR_CMD} update -y
fi
;;
rhel)
if [ ${PKG_MGR_CMD} = "microdnf" ]; then
if [ "$(ls /var/cache/yum/* 2>/dev/null | wc -l)" = 0 ]; then
echo "Running ${PKG_MGR_CMD} makecache ..."
${PKG_MGR_CMD} makecache
fi
else
if [ "$(ls /var/cache/${PKG_MGR_CMD}/* 2>/dev/null | wc -l)" = 0 ]; then
echo "Running ${PKG_MGR_CMD} check-update ..."
set +e
stderr_messages=$(${PKG_MGR_CMD} -q check-update 2>&1)
rc=$?
# centos 7 sometimes returns a status of 100 when it apears to work.
if [ $rc != 0 ] && [ $rc != 100 ]; then
echo "(Error) ${PKG_MGR_CMD} check-update produced the following error message(s):"
echo "${stderr_messages}"
exit 1
fi
set -e
fi
fi
;;
esac
}
# Checks if packages are installed and installs them if not
check_packages() {
case ${ADJUSTED_ID} in
debian)
if ! dpkg -s "$@" > /dev/null 2>&1; then
pkg_manager_update
${INSTALL_CMD} "$@"
fi
;;
rhel)
if ! rpm -q "$@" > /dev/null 2>&1; then
pkg_manager_update
${INSTALL_CMD} "$@"
fi
;;
esac
}
if [ "${ADJUSTED_ID}" = "rhel" ] && [ "${VERSION_CODENAME-}" = "centos7" ]; then
# As of 1 July 2024, mirrorlist.centos.org no longer exists.
# Update the repo files to reference vault.centos.org.
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
yum update -y
check_packages epel-release
fi
# Clean up
clean_up() {
local pkg
case ${ADJUSTED_ID} in
debian)
rm -rf /var/lib/apt/lists/*
;;
rhel)
for pkg in epel-release epel-release-latest packages-microsoft-prod; do
${PKG_MGR_CMD} -y remove $pkg 2>/dev/null || /bin/true
done
rm -rf /var/cache/dnf/* /var/cache/yum/*
rm -f /etc/yum.repos.d/docker-ce.repo
;;
esac
}
# Ensure that login shells get the correct path if the user updated the PATH using ENV.
rm -f /etc/profile.d/00-restore-env.sh
echo "export PATH=${PATH//$(sh -lc 'echo $PATH')/\$PATH}" > /etc/profile.d/00-restore-env.sh
chmod +x /etc/profile.d/00-restore-env.sh
# Determine the appropriate non-root user
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do
if id -u ${CURRENT_USER} > /dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break
fi
done
if [ "${USERNAME}" = "" ]; then
USERNAME=root
fi
elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
USERNAME=root
fi
updaterc() {
local _bashrc
local _zshrc
if [ "${UPDATE_RC}" = "true" ]; then
case $ADJUSTED_ID in
debian)
_bashrc=/etc/bash.bashrc
_zshrc=/etc/zsh/zshrc
;;
rhel)
_bashrc=/etc/bashrc
_zshrc=/etc/zshrc
;;
esac
echo "Updating ${_bashrc} and ${_zshrc}..."
if [[ "$(cat ${_bashrc})" != *"$1"* ]]; then
echo -e "$1" >> "${_bashrc}"
fi
if [ -f "${_zshrc}" ] && [[ "$(cat ${_zshrc})" != *"$1"* ]]; then
echo -e "$1" >> "${_zshrc}"
fi
fi
}
find_version_list() {
prefix="$1"
suffix="$2"
install_type=$3
ifLts="$4"
version_list=$5
java_ver=$6
check_packages jq
all_versions=$(curl -s https://api.adoptium.net/v3/info/available_releases)
if [ "${ifLts}" = "true" ]; then
major_version=$(echo "$all_versions" | jq -r '.most_recent_lts')
elif [ "${java_ver}" = "latest" ]; then
major_version=$(echo "$all_versions" | jq -r '.most_recent_feature_release')
else
major_version=$(echo "$java_ver" | cut -d '.' -f 1)
fi
# Remove the hardcoded fallback as this fails for new jdk latest version released ex: 24
# Related Issue: https://github.com/devcontainers/features/issues/1308
if [ "${JDK_DISTRO}" = "ms" ]; then
# Check if the requested version is available in the 'ms' distribution
echo "Check if OpenJDK is available for version ${major_version} for ${JDK_DISTRO} Distro"
available_versions=$(su ${USERNAME} -c ". ${SDKMAN_DIR}/bin/sdkman-init.sh && sdk list ${install_type} | grep ${JDK_DISTRO} | grep -oE '[0-9]+(\.[0-9]+(\.[0-9]+)?)?' | sort -u")
if echo "${available_versions}" | grep -q "^${major_version}"; then
echo "JDK version ${major_version} is available in ${JDK_DISTRO}..."
else
echo "JDK version ${major_version} not available in ${JDK_DISTRO}.... Switching to (tem)."
JDK_DISTRO="tem"
fi
fi
echo "JDK_DISTRO: ${JDK_DISTRO}"
if [ "${install_type}" != "java" ]; then
regex="${prefix}\\K[0-9]+\\.?[0-9]*\\.?[0-9]*${suffix}"
else
regex="${prefix}\\K${major_version}\\.?[0-9]*\\.?[0-9]*${suffix}${JDK_DISTRO}\\s*"
fi
declare -g ${version_list}="$(su ${USERNAME} -c ". \${SDKMAN_DIR}/bin/sdkman-init.sh && sdk list ${install_type} 2>&1 | grep -oP \"${regex}\" | tr -d ' ' | sort -rV")"
}
# Use SDKMAN to install something using a partial version match
sdk_install() {
local install_type=$1
local requested_version=$2
local prefix=$3
local suffix="${4:-"\\s*"}"
local full_version_check=${5:-".*-[a-z]+"}
local set_as_default=${6:-"true"}
pkgs=("maven" "gradle" "ant" "groovy")
pkg_vals="${pkgs[@]}"
if [ "${requested_version}" = "none" ]; then return; fi
if [ "${requested_version}" = "default" ]; then
requested_version=""
elif [[ "${pkg_vals}" =~ "${install_type}" ]] && [ "${requested_version}" = "latest" ]; then
requested_version=""
elif [ "${requested_version}" = "lts" ]; then
find_version_list "$prefix" "$suffix" "$install_type" "true" version_list "${requested_version}"
requested_version="$(echo "${version_list}" | head -n 1)"
elif echo "${requested_version}" | grep -oE "${full_version_check}" > /dev/null 2>&1; then
echo "${requested_version}"
else
find_version_list "$prefix" "$suffix" "$install_type" "false" version_list "${requested_version}"
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ]; then
requested_version="$(echo "${version_list}" | head -n 1)"
else
set +e
requested_version="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|-|$)")"
set -e
fi
if [ -z "${requested_version}" ] || ! echo "${version_list}" | grep "^${requested_version//./\\.}$" > /dev/null 2>&1; then
echo -e "Version $2 not found. Available versions:\n${version_list}" >&2
exit 1
fi
fi
if [ "${set_as_default}" = "true" ]; then
JAVA_VERSION=${requested_version}
fi
su ${USERNAME} -c "umask 0002 && . ${SDKMAN_DIR}/bin/sdkman-init.sh && sdk install ${install_type} ${requested_version} && sdk flush archives && sdk flush temp"
}
export DEBIAN_FRONTEND=noninteractive
architecture="$(uname -m)"
if [ "${architecture}" != "amd64" ] && [ "${architecture}" != "x86_64" ] && [ "${architecture}" != "arm64" ] && [ "${architecture}" != "aarch64" ]; then
echo "(!) Architecture $architecture unsupported"
exit 1
fi
# Install dependencies,
check_packages ca-certificates zip unzip sed findutils util-linux tar
# Make sure passwd (Debian) and shadow-utils RHEL family is installed
if [ ${ADJUSTED_ID} = "debian" ]; then
check_packages passwd
elif [ ${ADJUSTED_ID} = "rhel" ]; then
check_packages shadow-utils
fi
# minimal RHEL installs may not include curl, or includes curl-minimal instead.
# Install curl if the "curl" command is not present.
if ! type curl > /dev/null 2>&1; then
check_packages curl
fi
# Install sdkman if not installed
if [ ! -d "${SDKMAN_DIR}" ]; then
# Create sdkman group, dir, and set sticky bit
if ! cat /etc/group | grep -e "^sdkman:" > /dev/null 2>&1; then
groupadd -r sdkman
fi
usermod -a -G sdkman ${USERNAME}
umask 0002
# Install SDKMAN
curl -sSL "https://get.sdkman.io?rcupdate=false" | bash
chown -R "${USERNAME}:sdkman" ${SDKMAN_DIR}
find ${SDKMAN_DIR} -type d -print0 | xargs -d '\n' -0 chmod g+s
# Configure SDKMAN to use Chinese mirrors for faster download
if [ "${USE_CHINESE_MIRROR}" = "true" ] && [ -f "${SDKMAN_DIR}/etc/config" ]; then
# Backup original config
cp "${SDKMAN_DIR}/etc/config" "${SDKMAN_DIR}/etc/config.backup"
# Configure mirror based on user selection
case "${MIRROR_SOURCE}" in
"aliyun")
mirror_url="https://mirrors.aliyun.com/sdkman/candidates"
echo "Configuring SDKMAN to use Aliyun mirrors for faster download in China"
;;
"tencent")
mirror_url="https://mirrors.cloud.tencent.com/sdkman/candidates"
echo "Configuring SDKMAN to use Tencent Cloud mirrors for faster download in China"
;;
"huawei")
mirror_url="https://mirrors.huaweicloud.com/sdkman/candidates"
echo "Configuring SDKMAN to use Huawei Cloud mirrors for faster download in China"
;;
"official"|*)
mirror_url="https://api.sdkman.io/2/candidates"
echo "Using official SDKMAN mirrors"
;;
esac
# Update the config file
sed -i "s|sdkman.candidates.api=https://api.sdkman.io/2/candidates|sdkman.candidates.api=${mirror_url}|g" "${SDKMAN_DIR}/etc/config"
fi
# Add sourcing of sdkman into bashrc/zshrc files (unless disabled)
updaterc "export SDKMAN_DIR=${SDKMAN_DIR}\n. \${SDKMAN_DIR}/bin/sdkman-init.sh"
fi
sdk_install java ${JAVA_VERSION} "\\s*" "(\\.[a-z0-9]+)*-" ".*-[a-z]+$" "true"
# Additional java versions to be installed but not be set as default.
if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then
OLDIFS=$IFS
IFS=","
read -a additional_versions <<< "$ADDITIONAL_VERSIONS"
for version in "${additional_versions[@]}"; do
sdk_install java ${version} "\\s*" "(\\.[a-z0-9]+)*-" ".*-[a-z]+$" "false"
done
IFS=$OLDIFS
su ${USERNAME} -c ". ${SDKMAN_DIR}/bin/sdkman-init.sh && sdk default java ${JAVA_VERSION}"
fi
# Install Ant
if [[ "${INSTALL_ANT}" = "true" ]] && ! ant -version > /dev/null 2>&1; then
sdk_install ant ${ANT_VERSION}
fi
# Install Gradle
if [[ "${INSTALL_GRADLE}" = "true" ]] && ! gradle --version > /dev/null 2>&1; then
sdk_install gradle ${GRADLE_VERSION}
fi
# Install Maven
if [[ "${INSTALL_MAVEN}" = "true" ]] && ! mvn --version > /dev/null 2>&1; then
sdk_install maven ${MAVEN_VERSION}
fi
# Install Groovy
if [[ "${INSTALL_GROOVY}" = "true" ]] && ! groovy --version > /dev/null 2>&1; then
sdk_install groovy "${GROOVY_VERSION}"
fi
# Clean up
clean_up
echo "Done!"
#!/usr/bin/env bash
# Wrapper function that also installs JDK 11 if JDK 8 is selected since this is required for the Java extension
set -e
JAVA_VERSION="${1:-"default"}"
SDKMAN_DIR="${2:-"/usr/local/sdkman"}"
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
UPDATE_RC="${4:-"true"}"
ADDITIONAL_JAVA_VERSION="11"
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
chmod +x install.sh
is_jdk_8="false"
if echo "${JAVA_VERSION}" | grep -E '^8([\s\.]|$)' > /dev/null 2>&1; then
is_jdk_8="true"
fi
# If the user selected JDK 8, install the JDK 11 as well since this is needed by the Java extension
if [ "${is_jdk_8}" = "true" ]; then
echo "(*) Installing JDK ${ADDITIONAL_JAVA_VERSION} as Java VS Code extension requires a recent JDK..."
./install.sh "${ADDITIONAL_JAVA_VERSION}" "${SDKMAN_DIR}" "${USERNAME}" "${UPDATE_RC}"
jdk_11_folder="$(ls --format=single-column ${SDKMAN_DIR}/candidates/java | grep -oE -m 1 '11\..+')"
ln -s "${SDKMAN_DIR}/candidates/java/${jdk_11_folder}" /extension-java-home
# Determine the appropriate non-root user
username=""
possible_users=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
for current_user in "${POSSIBLE_USERS[@]}"; do
if id -u ${current_user} > /dev/null 2>&1; then
username=${current_user}
break
fi
done
if [ "${username}" = "" ]; then
username=root
fi
else
ln -s ${SDKMAN_DIR}/candidates/java/current /extension-java-home
fi
echo "(*) Installing JDK ${JAVA_VERSION}..."
./install.sh "${JAVA_VERSION}" "${SDKMAN_DIR}" "${USERNAME}" "${UPDATE_RC}"
if [ "${is_jdk_8}" = "true" ]; then
# Set current and default version to last SDK installed
jdk_full_version="$(ls --format=single-column "${SDKMAN_DIR}/candidates/java" | sort -rV | grep -oE -m 1 "${JAVA_VERSION}\\..+" )"
echo "(*) Setting default JDK to ${jdk_full_version}..."
. ${SDKMAN_DIR}/bin/sdkman-init.sh
sdk use java "${jdk_full_version}"
sdk default java "${jdk_full_version}"
fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment