16.04.3 LTS에 Oracle Sun JAVA를 설치하는 데 선호되는 방법은 무엇입니까?


Google 검색을 기반으로 두 가지 방법을 찾았습니다.

이전에 우분투 14.04.1 LTS에서 http://www.duinsoft.nl/packages.php?t=en을 통해 설명한 방법을 성공적으로 사용했습니다 :

  • duinsoft 리포지토리 추가 :
    $ sudo vi /etc/apt/sources.list
    라인 추가 : deb http://www.duinsoft.nl/pkg debs all

    또는 echo "deb http://www.duinsoft.nl/pkg debs all" | sudo tee -a /etc/apt/sources.list.d/duinsoft.list

  • 명령을 사용하여이 작업을 수행 할 수도 있습니다.
  • 저장소의 gpg 키 가져 오기 : $ sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 5CB26B26

  • 자바 설치 :
    $ sudo apt-get update
    $ sudo apt-get install update-sun-jre

  • 또는 시도한 적이없는 것처럼 보이는 "공식적인"방법

  • Oracle 리포지토리 추가 :
    $ sudo add-apt-repository ppa:webupd8team/java

  • 자바 설치 :
    $ sudo apt-get update
    $ sudo apt-get install oracle-java8-installer

  • 한 방법을 다른 방법으로 선택해야하는 이유가 있습니까?


    Both of these are not 100% official. One uses a custom repository (questionable), the other a PPA (less questionable, but still not fully official. The official method includes:

    1. Going to java.com and finding the link to the linux version.
    2. You will notice that there is 4 versions of the package, x64 and x86. Find the appropriate one for your PC, then choose the .tar.gz format when downloading.
    3. Extract the .tar.gz archive into a folder and chmod +x each file if needed. Then, this is technically done, but you need to be in the directory to invoke java. To fix this, you have to...
    4. Copy the directory to a place where anyone can see it and recursively set the permissions so that anyone can access it. A good place to copy the directory would be /usr/bin/java or /usr/java and while technically against the FHS, it works. Then, open a new terminal and invoke java. If the command is not found, then open /etc/environment and with path, use :. Java is now installed.