Cliquez ici pour une introduction à AWS Cloud 9 https://qiita.com/tu-kun/items/d7b4f1fa19cc93bc5b75
Java
$ java -version
java version "1.7.0_181"
OpenJDK Runtime Environment (amzn-x.x.xx.x.xx.amzn1-x86_64 u181-b00)
OpenJDK 64-Bit Server VM (build xx.xxx-b00, mixed mode)
Javac
$ javac -version
javac 1.7.0_181
Le paquet java8 est java-1.8.0-openjdk-devel
.
Il s'agit d'un package qui installe également OpenJDK pour les développeurs.
$ yum search java-1.8.0-openjdk-devel
Loaded plugins: priorities, update-motd, upgrade-helper
epel 12509/12509
1045 packages excluded due to repository priority protections
================================================ N/S matched: java-1.8.0-openjdk ================================================
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-javadoc-zip.noarch : OpenJDK API Documentation compressed in single archive
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle
Puisque yum install doit être exécuté en tant qu'utilisateur root, ajoutez-lui la commande sudo.
y
car il y a un endroit pour interagir avec ʻEst-ce ok [y / d / N]:` sur le chemin.$ sudo yum install java-1.8.0-openjdk-devel
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.5 kB 00:00:00
1045 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-openjdk-devel.x86_64 1:1.8.0.171-7.b10.37.amzn1 will be installed
--> Processing Dependency: java-1.8.0-openjdk(x86-64) = 1:1.8.0.171-7.b10.37.amzn1 for package: 1:java-1.8.0-openjdk-devel-1.8.0.171-7.b10.37.amzn1.x86_64
--> Processing Dependency: libawt_xawt.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-devel-1.8.0.171-7.b10.37.amzn1.x86_64
--> Processing Dependency: libawt_xawt.so()(64bit) for package: 1:java-1.8.0-openjdk-devel-1.8.0.171-7.b10.37.amzn1.x86_64
--> Running transaction check
---> Package java-1.8.0-openjdk.x86_64 1:1.8.0.171-7.b10.37.amzn1 will be installed
--> Processing Dependency: java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.171-7.b10.37.amzn1 for package: 1:java-1.8.0-openjdk-1.8.0.171-7.b10.37.amzn1.x86_64
--> Running transaction check
---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.171-7.b10.37.amzn1 will be installed
amzn-main/latest/filelists_db | 5.7 MB 00:00:13
amzn-updates/latest/filelists_db | 1.2 MB 00:00:00
epel/x86_64/filelists | 7.3 MB 00:00:01
--> Processing Dependency: copy-jdk-configs >= 1.1-3 for package: 1:java-1.8.0-openjdk-headless-1.8.0.171-7.b10.37.amzn1.x86_64
--> Processing Dependency: lksctp-tools(x86-64) for package: 1:java-1.8.0-openjdk-headless-1.8.0.171-7.b10.37.amzn1.x86_64
--> Running transaction check
---> Package copy-jdk-configs.noarch 0:1.2-1.2.amzn1 will be installed
---> Package lksctp-tools.x86_64 0:1.0.10-7.7.amzn1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================
Installing:
java-1.8.0-openjdk-devel x86_64 1:1.8.0.171-7.b10.37.amzn1 amzn-updates 12 M
Installing for dependencies:
copy-jdk-configs noarch 1.2-1.2.amzn1 amzn-main 13 k
java-1.8.0-openjdk x86_64 1:1.8.0.171-7.b10.37.amzn1 amzn-updates 249 k
java-1.8.0-openjdk-headless x86_64 1:1.8.0.171-7.b10.37.amzn1 amzn-updates 39 M
lksctp-tools x86_64 1.0.10-7.7.amzn1 amzn-main 89 k
Transaction Summary
=================================================================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 51 M
Installed size: 144 M
Is this ok [y/d/N]: Y
Downloading packages:
(1/5): copy-jdk-configs-1.2-1.2.amzn1.noarch.rpm | 13 kB 00:00:00
(2/5): java-1.8.0-openjdk-1.8.0.171-7.b10.37.amzn1.x86_64.rpm | 249 kB 00:00:05
(3/5): lksctp-tools-1.0.10-7.7.amzn1.x86_64.rpm | 89 kB 00:00:02
(4/5): java-1.8.0-openjdk-devel-1.8.0.171-7.b10.37.amzn1.x86_64.rpm | 12 MB 00:00:15
(5/5): java-1.8.0-openjdk-headless-1.8.0.171-7.b10.37.amzn1.x86_64.rpm | 39 MB 00:00:16
---------------------------------------------------------------------------------------------------------------------------------
Total 2.3 MB/s | 51 MB 00:00:21
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : copy-jdk-configs-1.2-1.2.amzn1.noarch 1/5
Installing : lksctp-tools-1.0.10-7.7.amzn1.x86_64 2/5
Installing : 1:java-1.8.0-openjdk-1.8.0.171-7.b10.37.amzn1.x86_64 3/5
Installing : 1:java-1.8.0-openjdk-headless-1.8.0.171-7.b10.37.amzn1.x86_64 4/5
Installing : 1:java-1.8.0-openjdk-devel-1.8.0.171-7.b10.37.amzn1.x86_64 5/5
Verifying : 1:java-1.8.0-openjdk-devel-1.8.0.171-7.b10.37.amzn1.x86_64 1/5
Verifying : 1:java-1.8.0-openjdk-1.8.0.171-7.b10.37.amzn1.x86_64 2/5
Verifying : 1:java-1.8.0-openjdk-headless-1.8.0.171-7.b10.37.amzn1.x86_64 3/5
Verifying : lksctp-tools-1.0.10-7.7.amzn1.x86_64 4/5
Verifying : copy-jdk-configs-1.2-1.2.amzn1.noarch 5/5
Installed:
java-1.8.0-openjdk-devel.x86_64 1:1.8.0.171-7.b10.37.amzn1
Dependency Installed:
copy-jdk-configs.noarch 0:1.2-1.2.amzn1 java-1.8.0-openjdk.x86_64 1:1.8.0.171-7.b10.37.amzn1
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.171-7.b10.37.amzn1 lksctp-tools.x86_64 0:1.0.10-7.7.amzn1
Complete!
Étant donné qu'AWS utilise des alternatives pour la gestion des versions Java, vous devez changer plutôt que simplement l'installer.
La version de java préfixée par «* +» est la version actuellement appliquée.
ʻEntrez pour conserver la sélection courante [+], ou tapez le numéro de sélection: Il y a un endroit pour interagir avec , alors entrez
2` qui est jre-1.8.0.
Java
$ sudo alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
2 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
Enter to keep the current selection[+], or type selection number: 2
Javac
$ sudo alternatives --config javac
There are 2 programs which provide 'javac'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin/javac
2 /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/javac
Enter to keep the current selection[+], or type selection number: 2
Enfin, vérifiez la version, et si elle passe à 1.8.0, vous avez terminé.
$ java -version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-b10)
OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode)
$ javac -version
javac 1.8.0_171
Non seulement vous serez satisfait de l'installation, mais n'oubliez pas de changer!
Recommended Posts