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
Difference between HTML and XHTML 1. XHTML elemen...
Preface In backend development, in order to preve...
Prepare the ingredients as shown above (ps: hadoo...
Keyboard Characters English ` backquote ~ tilde !...
Recently, when running an old RN project, the fol...
1. Create a table using HTML tags: Copy code The ...
Generally, click events will be divided into diff...
Table of contents introduction Ideas Establish ID...
A data volume container is a container specifical...
Preface The Linux system is controlled by the sys...
Html semantics seems to be a commonplace issue. G...
Quick Reading Why do we need to monitor SQL state...
This article shares the specific code of Vue usin...
Table of contents Overview Using mapped types to ...
The author has been working on a micro-frontend p...