Raspberry Pi – Software – Java
De pagina laat zien hoe je Java installeert op een Raspberry Pi.
Stap 1
– Log in met SSH
– Switch naar root met het commando:
sudo -s
Stap 2 – Installatie van Java
– Voeg Java toe aan apt-get met de volgende commando’s:
1 2 |
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" > /etc/apt/sources.list.d/webupd8team-java.list echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/webupd8team-java.list |
– Update apg-get repo’s: apt-get update
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB] Get:2 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease [15.5 kB] Get:3 http://mirrordirector.raspbian.org/raspbian stretch InRelease [15.0 kB] Get:4 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages [11.7 MB] Ign:2 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease Get:5 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main Sources [1,577 B] Get:6 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main armhf Packages [2,902 B] Get:7 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main Translation-en [1,556 B] Get:8 http://archive.raspberrypi.org/debian stretch/main armhf Packages [123 kB] Get:9 http://mirrordirector.raspbian.org/raspbian stretch/non-free armhf Packages [95.2 kB] Get:10 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [27.0 kB] Fetched 12.0 MB in 13s (900 kB/s) Reading package lists... Done W: GPG error: http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886 W: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu trusty InRelease' is not signed. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. |
– Installeer Java: apt-get install oracle-java8-installer
Je krijgt ook 2 schermen te zien om de license agreement te accepteren:
Output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: oracle-java8-set-default Suggested packages: 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 The following NEW packages will be installed: oracle-java8-installer oracle-java8-set-default 0 upgraded, 2 newly installed, 0 to remove and 127 not upgraded. Need to get 39.7 kB of archives. After this operation, 138 kB of additional disk space will be used. Do you want to continue? [Y/n] Y WARNING: The following packages cannot be authenticated! oracle-java8-installer oracle-java8-set-default Install these packages without verification? [y/N] y Get:1 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main armhf oracle-java8-installer all 8u151-1~webupd8~0 [32.9 kB] Get:2 http://ppa.launchpad.net/webupd8team/java/ubuntu trusty/main armhf oracle-java8-set-default all 8u151-1~webupd8~0 [6,788 B] Fetched 39.7 kB in 0s (502 kB/s) Preconfiguring packages ... Selecting previously unselected package oracle-java8-installer. (Reading database ... 122683 files and directories currently installed.) Preparing to unpack .../oracle-java8-installer_8u151-1~webupd8~0_all.deb ... Unpacking oracle-java8-installer (8u151-1~webupd8~0) ... Setting up oracle-java8-installer (8u151-1~webupd8~0) ... No /var/cache/oracle-jdk8-installer/wgetrc file found. Creating /var/cache/oracle-jdk8-installer/wgetrc and using default oracle-java8-installer wgetrc settings for it. Downloading Oracle Java 8... --2017-11-16 19:59:34-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz Resolving download.oracle.com (download.oracle.com)... 104.93.82.19, 104.93.82.8 Connecting to download.oracle.com (download.oracle.com)|104.93.82.19|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz [following] --2017-11-16 19:59:34-- https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.73.149.93, 2a02:26f0:7b:288::2d3e, 2a02:26f0:7b:298::2d3e Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.73.149.93|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1510862494_0ac007a7da5f5ef8addeda57047bd02f [following] --2017-11-16 19:59:34-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1510862494_0ac007a7da5f5ef8addeda57047bd02f Connecting to download.oracle.com (download.oracle.com)|104.93.82.19|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 81681158 (78M) [application/x-gzip] Saving to: ‘jdk-8u151-linux-arm32-vfp-hflt.tar.gz’ ... 2017-11-16 19:59:48 (5.96 MB/s) - ‘jdk-8u151-linux-arm32-vfp-hflt.tar.gz’ saved [81681158/81681158] Download done. Removing outdated cached downloads... ... #####Important######## To set Oracle JDK8 as default, install the "oracle-java8-set-default" package. E.g.: sudo apt install oracle-java8-set-default On Ubuntu systems, oracle-java8-set-default is most probably installed automatically with this package. ###################### Selecting previously unselected package oracle-java8-set-default. Processing triggers for desktop-file-utils (0.23-1) ... Processing triggers for hicolor-icon-theme (0.15-1) ... Processing triggers for shared-mime-info (1.8-1) ... (Reading database ... 122711 files and directories currently installed.) Preparing to unpack .../oracle-java8-set-default_8u151-1~webupd8~0_all.deb ... Unpacking oracle-java8-set-default (8u151-1~webupd8~0) ... Processing triggers for mime-support (3.60) ... Setting up oracle-java8-set-default (8u151-1~webupd8~0) ... Processing triggers for gnome-menus (3.13.3-9) ... |
– Java versie controleren: java -version
1 2 3 |
java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) Client VM (build 25.151-b12, mixed mode) |