본문 바로가기

Linux/Ubuntu

14.04에서 oracle jdk 설치하기

[출처] : http://ubuntuhandbook.org/index.php/2014/02/install-oracle-java-6-7-or-8-ubuntu-14-04/


This simple tutorial is going to show you how to easily install Oracle Java (JDK) 6, 7, or 8 in Ubuntu 14.04 Trusty Tahr via PPA.

There’s a Launchpad PPA (Personal Package Archive) maintained by webupd8.org, a popular Ubuntu Linux blog, which provides the most recent installers to automatically download and install Oracle Java JDK6 / JDK7 / JDK8 from oracle website. Note there are no actual Java files in this PPA.

To get started:

Press Ctrl+Alt+T on your keyboard to open a terminal window. When it opens, copy and paste the command below and hit enter. Input your user password when prompts and it will add the PPA repository into your system.

sudo add-apt-repository ppa:webupd8team/java

After that, update package lists via:

sudo apt-get update

To install Oracle Java 8, run:

sudo apt-get install oracle-java8-installer

Change the number 8 to 6 (or 7) in the code to install Java 6 (or 7).

While installation, you’ll be asked to agree the license and then the installer start downloading Java file from oracle website and install it on your system.

To set the default Java, run:

sudo apt-get install oracle-java8-set-default

Also change number 8 to the Java version you want.

Finally check whether everyting is OK:

java -version

It will output something like below:

java version “1.7.0_60″
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)


==============================================================================

그런데 말입니다.

oracle이 장난을 칩니다.

그래서 이제는 6, 7 version은 설치가 제대로 안됩니다.

아래처럼 직접 다운로드 받고 해당 폴더에 복사해 둔 뒤에 설치하면 됩니다.

Because I've received more than 50 emails about this, I though I'd make a post about it, to clear things up for everybody.

While Oracle Java 6 and 7 are not supported for quite a while, they were still available for download on Oracle's website until recently.


However, the binaries were removed about 10 days ago (?), so the Oracle Java (JDK) 6 and 7 installers available in the WebUpd8 Oracle Java PPA no longer work.

Oracle Java 6 and 7 are now only available for those with an Oracle Support account (which is not free), so I can't support this for the PPA packages.


From the Oracle Java downloads page:

"Updates for Java SE 7 released after April 2015, and updates for Java SE 6 released after April 2013 are only available to Oracle Customers through My Oracle Support (requires support login).

Java SE Advanced offers users commercial features, access to critical bug fixes, security fixes, and general maintenance".


It's highly recommended you update to Oracle Java 8. Check out the following articles for how to install Oracle Java 8 in Ubuntu (or Linux Mint and derivatives) or Debian via PPA.

If you have an Oracle Support account and you really need Oracle JDK 6 or 7, you can get the installers from the WebUpd8 PPA to work by downloading the binaries and placing them in the following folder:
  • /var/cache/oracle-jdk6-installer/ for JDK 6 (you'll need version 6u45)
  • /var/cache/oracle-jdk7-installer/ for JDK 7 (you'll need version 7u80 for 32bit and 64bit or 7u60 for arm)

... and then install the oracle-java6-installer or oracle-java7-installer package.


[출처] : http://justckh.blogspot.kr/2014/07/ubuntu-oracle-jdk-7-is-not-installed.html


Ubuntu에서 Oracle JDK를 설치하다 보면 아래와 같은 에러가 발생하는 경우가 있습니다.

Download done.
Removing outdated cached downloads...
sha256sum mismatch jdk-7u51-linux-x64.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error processing oracle-java7-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up gsfonts-x11 (0.22) ...
Errors were encountered while processing:
 oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

원인은 Oracle JDK 저장소에서 설치파일을 가져올 때 정상적인 resolving이 수행되지 않았기 때문으로 보입니다.

'/var/cache/oracle-jdk7-installer' 디렉토리에 들어가보면 설치 파일인 'jdk-7u65-linux-x64.tar.gz'의 용량이 0으로 표시됨을 알 수 있습니다.

즉, 다운로드가 정상적으로 수행되지 않은 것입니다.

Oracle 사이트 접속 후 jdk7 다운로드

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

'Accept License Agreement'를 선택하신 후 'jdk-7u65-linux-x64.tar.gz(64bit 전용)', 'jdk-7u65-linux-i586.tar.gz(32bit 전용)' 중 PC 환경에 적합한 파일을 다운로드 합니다.

※ 만약 파일명이 'jdk-7u65-linux-x64.gz'이라면 파일 명을 'jdk-7u65-linux-x64.tar.gz'로 수정해줍니다.

파일 경로 이동

다운로드 완료된 'jdk-7u65-linux-x64.tar.gz' 파일을 '/var/cache/oracle-jdk7-installer' 디렉토리로 이동합니다.

Oracle JDK 7 설치

sudo apt-get install oracle-java7-installer

다시 한번 apt-get을 활용하여 JDK7을 설치해줍니다.

'Linux > Ubuntu' 카테고리의 다른 글

16.04에서 oracle jdk 설치하기  (0) 2016.08.10
16.04에서 openjdk 설치하기  (0) 2016.08.10
mongoose 서버  (0) 2015.10.22
jsonrpc-cpp 빌드하기  (0) 2015.10.22
jsoncpp 빌드하기  (0) 2015.10.22