Skip to content

Install Java using Jenv

On both Linux and MacOS, follow the official jenv install procedure.

Then, download the required Java JDK and add them to jenv:

Linux

On linux, copy/paste the hole script bellow (and modify $JAVA_INSTALL_DIR if needed):

git clone https://github.com/jenv/jenv.git ~/.jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(jenv init -)"' >> ~/.bashrc
source ~/.bashrc
export JAVA_INSTALL_DIR=~/opt/java
mkdir -p $JAVA_INSTALL_DIR

cd $JAVA_INSTALL_DIR
wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u222-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u222b10.tar.gz
tar -zxvf OpenJDK8U-jdk_x64_linux_hotspot_8u222b10.tar.gz
rm OpenJDK8U-jdk_x64_linux_hotspot_8u222b10.tar.gz
jenv add jdk8u222-b10
source ~/.bashrc
jenv enable-plugin export
jenv global 1.8