This article mainly introduces how to install JDK in Linux environment. Because Java is often indispensable in Linux environment, the author will share with you the process of jdk1.8. 1. Installation EnvironmentOperating system: Red Hat Enterprise Linux 6 64-bit (version 6.6) JDK version: 1.8 Tools: Xshell5, Xftp5 Note: This article uses the Xshell5 tool to remotely connect to Linux for operation. It would be more convenient if you operate directly in the Linux visual interface. The principle is the same. 2. Installation stepsStep 1: Download the installation packageDownload jdk1.8 in Linux environment, please go to (official website) to download the jdk installation file; Since my Linux is 64-bit, I download jdk-8u131-linux-x64.tar.gz. As shown in the following figure: If Linux itself is connected to the Internet, we can directly download the JDK installation package through the wget command, as shown in the figure: If there is no external network environment, still install the above method to download the installation package, and then upload it to the server Step 2: Unzip the installation packageUpload the downloaded JDK installation package to the server and decompress it Decompression command to decompress 1 $ cd /home/xxxxxxxx 2 $ tar -zxvf jdk-8u131-linux-x64.tar.gz After the decompression is complete, you can see a directory named [jdk1.8.0_131] in the current directory, which contains relevant files We need to move all the data in the unzipped [jdk1.8.0_131] to the folder we need to install. We plan to install jdk in usr/java. We create a new java folder in the usr directory. mkdir /usr/java Copy the data in [jdk1.8.0_131] to the java directory mv /home/xxxxxxxx/jdk1.8.0_131 /usr/java Step 3: Modify environment variablesAt this point, we finally need to modify the environment variables through the command vim /etc/profile Use the vim editor to edit the profile file and add the following content to the end of the file (press "i" to enter the editing): export JAVA_HOME=/usr/java/jdk1.8.0_131 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin export PATH=$PATH:${JAVA_PATH} As shown in the figure: Then, save and exit (press: wq!) After saving, we also need to make this environment variable configuration information take effect, otherwise we can only restart the computer to take effect. Use the command source /etc/profile to make the profile file take effect immediately, as shown in the figure Step 4: Test whether the installation is successful
As shown in the figure: At this point, the installation is complete This concludes this article about installing JDK1.8 in Linux environment. I hope it will be helpful for everyone’s study, and I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: CSS3 flexible box flex to achieve three-column layout
>>: In-depth understanding of javascript prototype and prototype chain
1. Add the following code to http{} in nginx.conf...
Table of contents Packaging, launching and optimi...
Distinguish the differences between the filter, f...
Table of contents Stabilization Throttling Summar...
This article mainly introduces the pie chart data...
There were always problems when installing tortoi...
Let's take a look at the detailed method of b...
Table of contents introduce Link start Continue t...
<br />Choose the most practical one to talk ...
1. Window -> preferences to open the eclipse p...
First, you can open Moments and observe several l...
Html event list General Events: onClick HTML: Mous...
Supervisor Introduction Supervisor is a client/se...
nginx is our most commonly used server, often use...
This article briefly introduces how to install My...