Java SE Development Kit 8u161 --setup with alternatives

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

# yum localinstall jdk-8u161-linux-x64.rpm 

Loaded plugins: langpacks, ulninfo
Examining jdk-8u161-linux-x64.rpm: 2000:jdk1.8-1.8.0_161-fcs.x86_64
Marking jdk-8u161-linux-x64.rpm as an update to 2000:jdk1.8-1.8.0_151-fcs.x86_64
Resolving Dependencies
--> Running transaction check
---> Package jdk1.8.x86_64 2000:1.8.0_151-fcs will be updated
---> Package jdk1.8.x86_64 2000:1.8.0_161-fcs will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================
 Package               Arch                  Version                           Repository                           Size
=========================================================================================================================
Updating:
 jdk1.8                x86_64                2000:1.8.0_161-fcs                /jdk-8u161-linux-x64                276 M

Transaction Summary
=========================================================================================================================
Upgrade  1 Package

Total size: 276 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : 2000:jdk1.8-1.8.0_161-fcs.x86_64                                                                      1/2 
Unpacking JAR files...
	tools.jar...
	plugin.jar...
	javaws.jar...
	deploy.jar...
	rt.jar...
	jsse.jar...
	charsets.jar...
	localedata.jar...
  Cleanup    : 2000:jdk1.8-1.8.0_151-fcs.x86_64                                                                      2/2 
  Verifying  : 2000:jdk1.8-1.8.0_161-fcs.x86_64                                                                      1/2 
  Verifying  : 2000:jdk1.8-1.8.0_151-fcs.x86_64                                                                      2/2 

Updated:
  jdk1.8.x86_64 2000:1.8.0_161-fcs                                                                                       

Complete!

# alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 3
# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 3
# update-alternatives --config java

here are 5 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre/bin/java)
   2           java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161-2.6.12.0.0.1.el7_4.x86_64/jre/bin/java)
   3           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   4           /usr/java/jdk1.8.0_161/jre/bin/java
   5           /usr/java/latest/bin/java

Enter to keep the current selection[+], or type selection number: 5

# java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
# alternatives --config javac

There are 5 programs which provide 'javac'.

  Selection    Command
-----------------------------------------------
   1           java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161-2.6.12.0.0.1.el7_4.x86_64/bin/javac)
*+ 2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/bin/javac)
   3           /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javac
   4           /usr/java/jdk1.8.0_161/bin/javac
   5           /usr/java/latest/bin/javac

Enter to keep the current selection[+], or type selection number: 5

# javac -version
javac 1.8.0_161

Done :smiley:

Recommended Posts

Java SE Development Kit 8u161 --setup with alternatives
Java SE Development Kit (JDK) setup procedure on Windows
Prepare Java development environment with Atom
Html5 development with Java using TeaVM
Prepare Java development environment with VS Code
Java development with Codenvy: Hello World! Run
Game development with two people using java 2
Game development with two people using java 1
Game development with two people using java 3
Java development with Codenvy: Console app debug
24 hours struggling with Android development, Java Optional
Students challenged Java SE 7/8 Bronze with no diligence.
Is Java SE8 Silver useful for Java development work? ??
Switch versions with alternatives after yum install java
Build a Java development environment with VS Code
Java development training
Java SE Overview
[Java development] Java memory
Java SE 7 memo
Java SE Subscription
Build Java development environment with VS Code on Mac
Experienced Java users get started with Android application development
Make Calendar gadgets made with JavaFX compatible with Java SE 9
Build Java development environment with WSL2 Docker VS Code
How to build Java development environment with VS Code
[Environment construction] Build a Java development environment with VS Code!
Build Java program development environment with Visual Studio Code
[Java] Development with multiple files using package and import
Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)