English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
First, environment
VMware12 Pro
CentOS-6.7-i386-bin-DVD1
jdk-8u151-linux-i586
Second, detailed installation steps
Prerequisite: need to uninstall JDK on your Linux
rpm-qa| grepjdk will display all the installation packages that contain the string jdk rpm-e--nodeps corresponding to each package name will uninstall the corresponding package
after java -version shows
just uninstalled.
I have installed JDK before1.7I need to uninstall, if you haven't installed it, start from below
1go to the official website to download JDK
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
you need to select the small circle marked in red in the picture, then you can install it, which means you agree to the license agreement
because my virtual system is32bit, so I will32bit JDK, according to your situation, see specifically.86represents32bit system, x64represents64bit system.
Don't know the system bit of the server, use this command directly:
2. Upload and unzip JDK
Some people may not know what the rz command is, why don't you have it?
This is a simple upload and download tool. If you haven't installed it before, you can install it, it's very useful
Check whether lrzsz is installed before installation:
rpm –q l lrzsz
If not installed, you can use the following command to install:
yum install lrzsz –y
After that, you can use rz to upload local files to the current directory of the server, and sz followed by the specified file directory can download it to the local machine
Alright, after the JDK is uploaded, it looks like this:
Unzip, etc., it's a bit slow, so it's unzipped to the current directory:
3. Move the location
For easy management in the future, I moved the JDK directory to a different location and renamed it
Now let's go and see the JDK, ok, JDK1.8It already exists, that JDK1.7Don't worry, it's the one I installed before
The ls | grep jdk command is a pipeline command, which lists the files in the current directory and retrieves those that contain jdk
4. Configure environment variables
First use vim to open/etc/profile
Add it at the bottom of the file, save and exit
Run the following command to make the configuration take effect immediately
Now through java -version and javac -Check the version command, the two results are the same
OK, JDK configuration is complete!
Summary
The following is the detailed step-by-step guide to installing JDK on Linxu server introduced by the editor, hoping it will be helpful to everyone. If you have any questions, please leave a message, and the editor will reply to everyone in time. We are also very grateful for everyone's support for the Yelling Tutorial website!
Declaration: The content of this article is from the network, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, does not edit the content manually, and does not assume relevant legal liabilities. If you find any content suspected of copyright infringement, please send an email to: notice#w3Please replace # with @ when sending an email for reporting, and provide relevant evidence. Once verified, this website will immediately delete the content suspected of infringement.