First install the directory where the JDK binary will live
sudo mkdir -p /usr/lib/jvm
Download and extract binary (use login)
Username | Password |
---|---|
[email protected] | Test1234$ |
sudo tar zxvf jdk-version-linux-x64.tar.gz -C /usr/lib/jvm
Tell the system that there's a new Java version available:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_version/bin/java" 1
Set the new JDK as the default:
sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_version/bin/java
Verify Java is working:
java -version
Install alias for keytool
sudo update-alternatives --install "/usr/bin/keytool" "keytool" "/usr/lib/jvm/jdk1.8.0_version/bin/keytool" 1
Install Certifcate Example
keytool -import -trustcacerts -keystore "/usr/lib/jvm/jdk1.8.0_version/jre/lib/security/cacerts" -storepass changeit -alias cert-name.crt -import -file cert-name.crt
Set JAVA_HOME
in .bashrc
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_version/
Source: https://docs.datastax.com/en/jdk-install/doc/jdk-install/installOracleJdkDeb.html