Skip to content

Instantly share code, notes, and snippets.

@apzentral
Created July 18, 2022 02:46
Show Gist options
  • Save apzentral/077fe8c8d4ff03962a29fc2c0bf5d44f to your computer and use it in GitHub Desktop.
Save apzentral/077fe8c8d4ff03962a29fc2c0bf5d44f to your computer and use it in GitHub Desktop.
Install java script
#!/usr/bin/env bash
JAVA_VERSION=jdk1.8.0_05
JAVA_FILE_NAME="jdk-8u5-linux-i586.tar.gz"
sudo tar xvzf "${JAVA_FILE_NAME}" -C /usr/java
JAVA_HOME="/usr/java/${JAVA_VERSION}/"
sudo update-alternatives --install /usr/bin/java java ${JAVA_HOME%*/}/bin/java 20000
sudo update-alternatives --install /usr/bin/javac javac ${JAVA_HOME%*/}/bin/javac 20000
update-alternatives --config java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment