====== JDKをインストールして使用する ======
開発目的や、汎用ハードウェア上での業務利用においては、JDKは無料で利用できます。\\
開発時にMA-E3xxの実機上でJDKを動作させたい、という場合、PPAにて導入が可能です。
参考URL : [[http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html]]
この方法でJDKを導入する場合、必要なストレージ容量の関係から、[[mae3xx_ope:extend_by_sd:start]] を参考に\\
SDカードの併用をお勧めします。
\\
===== セットアップ =====
PPA を追加します。
user1@plum:~$ sudo add-apt-repository ppa:webupd8team/java
[sudo] password for user1:
Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK6 / JDK7 / JDK8). There are no actual Java files in this PPA.
More info:
- for Oracle Java 7: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
- for Oracle Java 8: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
Debian installation instructions: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html
More info: https://launchpad.net/~webupd8team/+archive/java
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmphv3qqr/secring.gpg' created
gpg: keyring `/tmp/tmphv3qqr/pubring.gpg' created
gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmphv3qqr/trustdb.gpg: trustdb created
gpg: key EEA14886: public key "Launchpad VLC" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
user1@plum:~$
\\
パッケージデータベースをアップデートします。
user1@plum:~$ sudo apt-get update
Ign http://ppa.launchpad.net saucy InRelease
Ign http://ports.ubuntu.com saucy InRelease
Get:1 http://ppa.launchpad.net saucy Release.gpg [316 B]
Get:2 http://ppa.launchpad.net saucy Release [11.9 kB]
Ign http://ports.ubuntu.com saucy-updates InRelease
Ign http://ports.ubuntu.com saucy-security InRelease
Hit http://ports.ubuntu.com saucy Release.gpg
Hit http://ports.ubuntu.com saucy-updates Release.gpg
Get:3 http://ppa.launchpad.net saucy/main armhf Packages [2825 B]
Hit http://ports.ubuntu.com saucy-security Release.gpg
Hit http://ports.ubuntu.com saucy Release
Hit http://ports.ubuntu.com saucy-updates Release
Hit http://ports.ubuntu.com saucy-security Release
Hit http://ports.ubuntu.com saucy/main armhf Packages
Ign http://ppa.launchpad.net saucy/main Translation-en
Hit http://ports.ubuntu.com saucy/restricted armhf Packages
Hit http://ports.ubuntu.com saucy/universe armhf Packages
Hit http://ports.ubuntu.com saucy/main Translation-en
Hit http://ports.ubuntu.com saucy/restricted Translation-en
Hit http://ports.ubuntu.com saucy/universe Translation-en
Hit http://ports.ubuntu.com saucy-updates/main armhf Packages
Hit http://ports.ubuntu.com saucy-updates/restricted armhf Packages
Hit http://ports.ubuntu.com saucy-updates/universe armhf Packages
Hit http://ports.ubuntu.com saucy-updates/main Translation-en
Hit http://ports.ubuntu.com saucy-updates/restricted Translation-en
Hit http://ports.ubuntu.com saucy-updates/universe Translation-en
Hit http://ports.ubuntu.com saucy-security/main armhf Packages
Hit http://ports.ubuntu.com saucy-security/restricted armhf Packages
Hit http://ports.ubuntu.com saucy-security/universe armhf Packages
Hit http://ports.ubuntu.com saucy-security/main Translation-en
Hit http://ports.ubuntu.com saucy-security/restricted Translation-en
Hit http://ports.ubuntu.com saucy-security/universe Translation-en
Fetched 15.0 kB in 8s (1686 B/s)
Reading package lists... Done
user1@plum:~$
\\
oracle-java8-installer を "apt-get" コマンドでインストールします。
user1@plum:~$ sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
binutils gsfonts gsfonts-x11 java-common libfontenc1 libfreetype6 libxfont1 x11-common xfonts-encodings
xfonts-utils
Suggested packages:
binutils-doc default-jre equivs binfmt-support visualvm ttf-baekmuk ttf-unfonts ttf-unfonts-core
ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming firefox
firefox-2 iceweasel mozilla-firefox iceape-browser mozilla-browser epiphany-gecko epiphany-webkit
epiphany-browser galeon midbrowser moblin-web-browser xulrunner xulrunner-1.9 konqueror chromium-browser
midori google-chrome
The following NEW packages will be installed:
binutils gsfonts gsfonts-x11 java-common libfontenc1 libfreetype6 libxfont1 oracle-java8-installer
x11-common xfonts-encodings xfonts-utils
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 8107 kB of archives.
After this operation, 16.1 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://ppa.launchpad.net/webupd8team/java/ubuntu/ saucy/main oracle-java8-installer all 8u0-1~webupd8~5 [18.7 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports/ saucy/main libfontenc1 armhf 1:1.1.2-1 [13.0 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports/ saucy-updates/main libfreetype6 armhf 2.4.12-0ubuntu1.1 [287 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports/ saucy-updates/main libxfont1 armhf 1:1.4.6-1ubuntu0.1 [110 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports/ saucy/main binutils armhf 2.23.52.20130913-0ubuntu1 [3430 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports/ saucy/main java-common all 0.48ubuntu2 [134 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports/ saucy/main gsfonts all 1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1 [3374 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports/ saucy/main x11-common all 1:7.7+1ubuntu6 [58.6 kB]
Get:9 http://ports.ubuntu.com/ubuntu-ports/ saucy/main xfonts-encodings all 1:1.0.4-1ubuntu1 [583 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports/ saucy/main xfonts-utils armhf 1:7.7~1ubuntu1 [89.4 kB]
Get:11 http://ports.ubuntu.com/ubuntu-ports/ saucy/main gsfonts-x11 all 0.22 [9108 B]
Fetched 8107 kB in 11s (722 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libfontenc1:armhf.
(Reading database ... 19200 files and directories currently installed.)
Unpacking libfontenc1:armhf (from .../libfontenc1_1%3a1.1.2-1_armhf.deb) ...
Selecting previously unselected package libfreetype6:armhf.
Unpacking libfreetype6:armhf (from .../libfreetype6_2.4.12-0ubuntu1.1_armhf.deb) ...
Selecting previously unselected package libxfont1:armhf.
Unpacking libxfont1:armhf (from .../libxfont1_1%3a1.4.6-1ubuntu0.1_armhf.deb) ...
Selecting previously unselected package binutils.
Unpacking binutils (from .../binutils_2.23.52.20130913-0ubuntu1_armhf.deb) ...
Selecting previously unselected package java-common.
Unpacking java-common (from .../java-common_0.48ubuntu2_all.deb) ...
Setting up binutils (2.23.52.20130913-0ubuntu1) ...
Processing triggers for libc-bin ...
Selecting previously unselected package oracle-java8-installer.
(Reading database ... 19362 files and directories currently installed.)
Unpacking oracle-java8-installer (from .../oracle-java8-installer_8u0-1~webupd8~5_all.deb) ...
Selecting previously unselected package gsfonts.
Unpacking gsfonts (from .../gsfonts_1%3a8.11+urwcyr1.0.7~pre44-4.2ubuntu1_all.deb) ...
Selecting previously unselected package x11-common.
Unpacking x11-common (from .../x11-common_1%3a7.7+1ubuntu6_all.deb) ...
Selecting previously unselected package xfonts-encodings.
Unpacking xfonts-encodings (from .../xfonts-encodings_1%3a1.0.4-1ubuntu1_all.deb) ...
Selecting previously unselected package xfonts-utils.
Unpacking xfonts-utils (from .../xfonts-utils_1%3a7.7~1ubuntu1_armhf.deb) ...
Selecting previously unselected package gsfonts-x11.
Unpacking gsfonts-x11 (from .../gsfonts-x11_0.22_all.deb) ...
Processing triggers for shared-mime-info ...
Processing triggers for mime-support ...
Processing triggers for ureadahead ...
Setting up libfontenc1:armhf (1:1.1.2-1) ...
Setting up libfreetype6:armhf (2.4.12-0ubuntu1.1) ...
Setting up libxfont1:armhf (1:1.4.6-1ubuntu0.1) ...
Setting up java-common (0.48ubuntu2) ...
Setting up oracle-java8-installer (8u0-1~webupd8~5) ...
Downloading Oracle Java 8...
--2014-03-20 12:52:15-- http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-arm-vfp-hflt.tar.gz
Resolving download.oracle.com (download.oracle.com)... 96.17.199.16, 124.40.52.88
Connecting to download.oracle.com (download.oracle.com)|96.17.199.16|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-arm-vfp-hflt.tar.gz [following]
--2014-03-20 12:52:15-- https://edelivery.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-arm-vfp-hflt.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.10.6.140
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.10.6.140|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-arm-vfp-hflt.tar.gz?AuthParam=1395287656_439e541f0d105ee9fa684c0a62cf2f3c [following]
--2014-03-20 12:52:16-- http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-arm-vfp-hflt.tar.gz?AuthParam=1395287656_439e541f0d105ee9fa684c0a62cf2f3c
Connecting to download.oracle.com (download.oracle.com)|96.17.199.16|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 87570241 (84M) [application/x-gzip]
Saving to: 'jdk-8-linux-arm-vfp-hflt.tar.gz'
0K ........ ........ ........ ........ ........ ........ 3% 7.18M 11s
3072K ........ ........ ........ ........ ........ ........ 7% 12.2M 9s
6144K ........ ........ ........ ........ ........ ........ 10% 12.3M 8s
9216K ........ ........ ........ ........ ........ ........ 14% 12.0M 7s
12288K ........ ........ ........ ........ ........ ........ 17% 11.2M 7s
15360K ........ ........ ........ ........ ........ ........ 21% 10.8M 6s
18432K ........ ........ ........ ........ ........ ........ 25% 11.1M 6s
21504K ........ ........ ........ ........ ........ ........ 28% 11.2M 6s
24576K ........ ........ ........ ........ ........ ........ 32% 11.2M 5s
27648K ........ ........ ........ ........ ........ ........ 35% 11.2M 5s
30720K ........ ........ ........ ........ ........ ........ 39% 11.1M 5s
33792K ........ ........ ........ ........ ........ ........ 43% 10.2M 4s
36864K ........ ........ ........ ........ ........ ........ 46% 11.8M 4s
39936K ........ ........ ........ ........ ........ ........ 50% 11.1M 4s
43008K ........ ........ ........ ........ ........ ........ 53% 11.1M 4s
46080K ........ ........ ........ ........ ........ ........ 57% 10.1M 3s
49152K ........ ........ ........ ........ ........ ........ 61% 10.7M 3s
52224K ........ ........ ........ ........ ........ ........ 64% 10.9M 3s
55296K ........ ........ ........ ........ ........ ........ 68% 5.16M 3s
58368K ........ ........ ........ ........ ........ ........ 71% 7.25M 2s
61440K ........ ........ ........ ........ ........ ........ 75% 11.0M 2s
64512K ........ ........ ........ ........ ........ ........ 79% 12.6M 2s
67584K ........ ........ ........ ........ ........ ........ 82% 12.8M 1s
70656K ........ ........ ........ ........ ........ ........ 86% 11.1M 1s
73728K ........ ........ ........ ........ ........ ........ 89% 11.2M 1s
76800K ........ ........ ........ ........ ........ ........ 93% 10.5M 1s
79872K ........ ........ ........ ........ ........ ........ 96% 11.3M 0s
82944K ........ ........ ........ ........ ........ 100% 10.7M=8.1s
2014-03-20 12:52:24 (10.4 MB/s) - 'jdk-8-linux-arm-vfp-hflt.tar.gz' saved [87570241/87570241]
Download done.
Removing outdated cached downloads...
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: warning: /etc/alternatives/keytool has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: warning: /etc/alternatives/orbd has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/orbd to provide /usr/bin/orbd (orbd) in auto mode
update-alternatives: warning: /etc/alternatives/pack200 has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: warning: /etc/alternatives/policytool has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode
update-alternatives: warning: /etc/alternatives/rmid has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: warning: /etc/alternatives/rmiregistry has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: warning: /etc/alternatives/servertool has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/servertool to provide /usr/bin/servertool (servertool) in auto mode
update-alternatives: warning: /etc/alternatives/tnameserv has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/tnameserv to provide /usr/bin/tnameserv (tnameserv) in auto mode
update-alternatives: warning: /etc/alternatives/unpack200 has been changed (manually or by a script); switching to manual updates only
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/extcheck to provide /usr/bin/extcheck (extcheck) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/idlj to provide /usr/bin/idlj (idlj) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javah to provide /usr/bin/javah (javah) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jhat to provide /usr/bin/jhat (jhat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jsadebugd to provide /usr/bin/jsadebugd (jsadebugd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/native2ascii to provide /usr/bin/native2ascii (native2ascii) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/schemagen to provide /usr/bin/schemagen (schemagen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/wsgen to provide /usr/bin/wsgen (wsgen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/wsimport to provide /usr/bin/wsimport (wsimport) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode
Oracle JDK 8 installed
Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ...
Setting up x11-common (1:7.7+1ubuntu6) ...
* Setting up X socket directories... [ OK ]
Processing triggers for ureadahead ...
Setting up xfonts-encodings (1:1.0.4-1ubuntu1) ...
Setting up xfonts-utils (1:7.7~1ubuntu1) ...
Setting up gsfonts-x11 (0.22) ...
Processing triggers for libc-bin ...
localepurge: Disk space freed in /usr/share/locale: 0 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB
Total disk space freed by localepurge: 0 KiB
user1@plum:~$
インストールの途中に、ライセンスへの同意を求めるダイアログが表示されます。
{{:mae3xx_devel:use_jdk:java8_licenseagreement_00.png?640|}}
{{:mae3xx_devel:use_jdk:java8_licenseagreement_01.png?640|}}
\\
===== 導入した JDK の起動確認 =====
以上でJDKの導入ができました。\\
起動を確認してみます。
user1@plum:~$ java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)
user1@plum:~$ javac -version
javac 1.8.0
\\
/usr/lib/jvm/java-8-oracle/ 以下へセットアップされますので、使用する場合には\\
適宜 "JAVA\_HOME" を設定してください。
user1@plum:~$ ls -l /usr/lib/jvm/java-8-oracle/
total 20900
-r--r--r-- 1 root root 3244 Mar 20 12:53 COPYRIGHT
-r--r--r-- 1 root root 40 Mar 20 12:53 LICENSE
-r--r--r-- 1 root root 159 Mar 20 12:53 README.html
-rw-r--r-- 1 root root 125105 Mar 20 12:52 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r--r--r-- 1 root root 178445 Mar 20 12:53 THIRDPARTYLICENSEREADME.txt
drwxr-xr-x 2 root root 4096 Mar 20 12:52 bin
drwxr-xr-x 4 root root 4096 Mar 20 12:53 db
drwxr-xr-x 3 root root 4096 Mar 20 12:53 include
drwxr-xr-x 4 root root 4096 Mar 20 12:53 jre
drwxr-xr-x 3 root root 4096 Mar 20 12:52 lib
drwxr-xr-x 4 root root 4096 Mar 20 12:53 man
-rw-r--r-- 1 root root 545 Mar 20 12:52 release
-rw-r--r-- 1 root root 21051696 Mar 20 12:53 src.zip