Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```sh
- # Adding ppa to local repository
- sudo add-apt-repository ppa:webupd8team/java
- # Updating repository archives
- sudo apt update
- # Installing Oracle Java8
- sudo apt install -y oracle-java8-installer
- # Verifying the java installation
- javac -version
- # Setting Oracle Java8 as default (In case of multiple java versions)
- sudo apt install -y oracle-java8-set-default
- # Setting up environment variable (Also, add this to the `~/.bashrc` file to apply for next boot)
- export JAVA_HOME=/usr/lib/jvm/java-8-oracle
- export PATH=$PATH:$JAVA_HOME/bin
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement