Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Installation JDK 1.8 under CentOS7     - How to modify the Sublime in Tab four spaces (Linux)

- BCP importing and exporting large amounts of data Practice (Database)

- Oracle 11G R2 DataGuard structures (Database)

- GNU / Linux enable Intel Rapid Start (Linux)

- Java interface (Programming)

- How to use Android Studio development / debugging Android source code (Linux)

- MongoDB simple replication configuration (Database)

- Three minutes to teach you to easily grasp the grep command regular expression (Linux)

- 6 common PHP security attacks (Linux)

- Nine artifact control disk partition under Linux (Linux)

- Caffe install under Ubuntu 14.04 64bit (Linux)

- 10 Regulation of painless SQL Schema (Database)

- ElasticSearch - Basic Concepts (Server)

- Use of the storage-level replication technology will quickly clone a ASM database to the target environment (Database)

- Python exception summary (Programming)

- RHEL5.8 physical opportunities to Read-only file system (Linux)

- Cache implementation APP interacts with the server-side interface control Session (Server)

- C # asynchronous delegates (Programming)

- Java implementation chain store binary search tree (recursive method) (Programming)

- Python Dir find a folder several files (Programming)

  Installation JDK 1.8 under CentOS7
  Add Date : 2018-11-21      
  CentOS 7 is the current default jdk1.6 and 1.7. If you need a later version 1.8, we need a little extra means.

First, we need the next page from the latest version of jdk. Oracle provides rpm packages and tar.gz package. In order to save trouble, directly download a rpm package bin.

After the download is complete, you can use the rpm command to install, but prefer to use yum to get lazy.

# Yum localinstall jdk-8u20-linux-x64.rpm -y
Resolving Dependencies
-> Running transaction check
---> Package jdk1.8.0_20.x86_64 2000: 1.8.0_20-fcs will be installed
-> Finished Dependency Resolution
  jdk1.8.0_20.x86_64 2000: 1.8.0_20-fcs

After installation, in order to save space, rpm packages can also be deleted.

This is in fact jdk under / usr / java directory to configure a set of environment. View this directory, we can see more than a directory jdk1.8.0_20, while soft chain link to the next and last two default directories.

$ Ls -al / usr / java
total 12
drwxr-xr-x. 3 root root 4096 Oct 13 22:10.
drwxr-xr-x. 15 root root 4096 Jul 31 04:27 ..
lrwxrwxrwx 1 root root 16 Oct 13 22:10 default -.> / usr / java / latest
drwxr-xr-x. 9 root root 4096 Oct 13 22:10 jdk1.8.0_20
lrwxrwxrwx 1 root root 21 Oct 13 22:10 latest -.> /usr/java/jdk1.8.0_20

But so far it has not been in practical use. We need alternative tools to manage.

Because of soft links, if we will point to the configuration of the contents of / usr / java / default / bin / xxx, after installation jdk 1.9 or even 2.0, so long as the direct link to modify in soft, without having to do so again. So below I will use the / usr / java / default / new java home.

However, occasionally passing you, if do not intend to do so, but want to specify the version without using jdk1.8.0_20 want to change your own default will replace jdk1.8.0_20. The following are all so similar situation, please note.

First, let's view the current alternative environment.

# Alternatives --config java
There is 1 program that provides 'java'.
  Selection Command
* + 1 /usr/lib/jvm/java-1.7.0-openjdk-
Enter to keep the current selection [+], or type selection number: ^ C

We note that under, alternatives already have a java, and our goal is to not destroy the original environmental conditions of a 1.8 increase. Of course, after the completion of all, of you can try to delete their own share of the installed rpm package .

We added alternative first java
# Alternatives --install / usr / bin / java java / usr / java / default / bin / java 2

Several parameters are better understood, the executable file is / usr / java / default / bin / java soft link to / usr / bin / java, configuration named java, the last parameter 2 is because we saw before, we've got a java, so the index to select 2.

Then continue the configuration

# Alternatives --config java
There are 2 programs which provide 'java'.
  Selection Command
* + 1 /usr/lib/jvm/java-1.7.0-openjdk-
  2 / usr / java / default / bin / java
Enter to keep the current selection [+], or type selection number: 2

We found out more than a choice, we point to the newly installed / usr / java / defalut / bin / java. Select this command.

Go look at:

# Alternatives --config java
There are 2 programs which provide 'java'.
  Selection Command
* 1 /usr/lib/jvm/java-1.7.0-openjdk-
 + 2 / usr / java / default / bin / java
Enter to keep the current selection [+], or type selection number: 2

We found that the + sign has been moved below.

Similarly, we'll configuration remaining

# Alternatives --install / usr / bin / jar jar / usr / java / default / bin / jar 2
# Alternatives --install / usr / bin / javac javac / usr / java / default / bin / javac 2
# Alternatives --set jar / usr / java / default / bin / jar
# Alternatives --set javac / usr / java / default / bin / javac

This will get.

Finally, we can verify the next:

$ Java -version
java version "1.8.0_20"
Java (TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot (TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
$ Javac -version
javac 1.8.0_20

Finally, we may need to configure the environment variables.
 Environment variables can be configured under ordinary users.
 You can write
$ Export JAVA_HOME = / usr / java / default

And other blabla.

However, we also want to write the configuration file. Depending on the specific shell may be. If using bash, add content in ~ / .bashrc or ~ / .bash_profile follows:

export JAVA_HOME = / usr / java / default
export JRE_HOME = / usr / java / default / jre
export PATH = $ PATH: $ JAVA_HOME / bin: $ JRE_HOME / bin
- How to use secure FTP file transfer (Server)
- The ORA-01113 error is handled with BBED without archiving (Database)
- SSH configuration under Linux (Linux)
- Let OS X support NTFS write file (Linux)
- SSH security note (Linux)
- Windows 8.1 hard drive to install Ubuntu 14.04 dual system reference tutorials and multi-drive Precautions (Linux)
- How Ubuntu Snappy Core 2 running on Raspberry Pi (Linux)
- MySQL root password reset under CentOS (Database)
- Java rewrite the hashcode method (Programming)
- Linux based serial programming (Programming)
- To achieve Linux Security (Linux)
- MySQL and MariaDB traditional master-slave cluster configuration (Database)
- Ubuntu amend resolv.conf restart failure problem (Linux)
- sed and awk in shell usage and some examples (Linux)
- Installation and Configuration JDK8 In CentOS 7 (Linux)
- Unix average load average load calculation method (Server)
- Tune in high resolution to 1280x800 in Fedora 14 (Linux)
- ActiveMQ memory settings and flow control (Linux)
- How to Install SeaMonkey 2.25 for Ubuntu (Linux)
- Linux system started to learn: Teaches you install Fedora 22 on VirtualBox (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.