Amazon Linuxにjdk 1.8をインストール


Java SE Development Kit 8 Downloads
からrpmをダウンロードして対象サーバーにアップロード
[bash gutter=”false”]
$ scp -i xxxxx.pem Downloads/jdk-8u40-linux-i586.rpm ec2-user@hostname:/home/ec2-user
[/bash]

対象サーバーにsshログインしてrpmをインストール
[bash gutter=”false”]
$ sudo rpm -ivh jdk-8u40-linux-i586.rpm
準備しています… ################################# [100%]
更新中 / インストール中…
1:jdk1.8.0_40-2000:1.8.0_40-fcs ################################# [100%]
Unpacking JAR files…
rt.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/jre/lib/rt.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
jsse.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/jre/lib/jsse.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
charsets.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/jre/lib/charsets.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
tools.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/lib/tools.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
localedata.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/jre/lib/ext/localedata.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
jfxrt.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/jre/lib/ext/jfxrt.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
plugin.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/jre/lib/plugin.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
javaws.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/jre/lib/javaws.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
deploy.jar…
/var/tmp/rpm-tmp.6br3Js: /usr/java/jdk1.8.0_40/bin/unpack200: /lib/ld-linux.so.2: bad ELF interpreter: そのようなファイルやディレクトリはありません
Error: unpack could not create JAR file:

/usr/java/jdk1.8.0_40/jre/lib/deploy.jar

Please refer to the Troubleshooting section of the Installation Instructions
on the download page.
[/bash]
エラー発生

対処方法: GCE上のCentOSインスタンスにOracleのjdkをインストールするまで。

[bash gutter=”false”]
$ sudo yum install ld-linux.so.2 libgcc_s.so.1
[/bash]

インストール再実行、一旦rpmパッケージを削除する必要あり
[bash gutter=”false”]
$ sudo rpm -e jdk1.8.0_40
$ sudo rpm -ivh jdk-8u40-linux-i586.rpm
準備しています… ################################# [100%]
更新中 / インストール中…
1:jdk1.8.0_40-2000:1.8.0_40-fcs ################################# [100%]
Unpacking JAR files…
rt.jar…
jsse.jar…
charsets.jar…
tools.jar…
localedata.jar…
jfxrt.jar…
plugin.jar…
javaws.jar…
deploy.jar…
[/bash]

インストールを確認
[bash gutter=”false”]
$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Client VM (build 25.45-b02, mixed mode, sharing)
[/bash]

,