Skip to content

Instantly share code, notes, and snippets.

@matthewhartman
Last active August 5, 2020 03:48
Show Gist options
  • Save matthewhartman/7c11c633f8d9d09dde1bc748381c0bbc to your computer and use it in GitHub Desktop.
Save matthewhartman/7c11c633f8d9d09dde1bc748381c0bbc to your computer and use it in GitHub Desktop.
Install Java JDK on Linux Debian

Install Java JDK On Linux (Debian)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment