Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install JDK runtime environment in Linux server

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about how to install the JDK operating environment in the Linux server. Many people may not know much about it. In order to make you understand better, the editor summarized the following contents. I hope you can get something according to this article.

Log in to the virtual machine and enter the terminal to switch to the root user, enter: su, then enter the password and then enter: cd. Back to root users

Second, check whether the Linux system has its own jdk: 1, input: java-version 2, found input: rpm-qa | grep java detects the installation package of jdk, (note: remember to download an input: apt-get install + command name when the rpm command is not available) 3, and then delete the packages one by one Enter: rpm-e-- nodeps + package name 4, and finally again: rpm-qa | grep java can check whether it has been deleted (this step has been uninstalled before, so there is no screenshot). Then enter the corresponding file in the terminal to create a new folder containing the jdk package, and enter: mkdir + directory name

4. Next, to modify the permissions of the folder, enter: chmod 777 + the name of the file to be deleted

5. Download the corresponding version of the installation package: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html on the official website

The landlord attached the downloaded JDK8 version. This article is the Linux x64 version.

JDK8 (Linux+x64) download address: jdk8 download address

6. After downloading, use the FileZilla file transmitter to transfer the jdk installation package to the corresponding folder of the virtual machine, or download it directly from Linux

7. Enter the directory of the corresponding file at the terminal, further decompress it, and enter tar-zxvf + the name of the package to be decompressed. The following picture shows the decompression process.

8. There are two ways to edit the configuration file and configure the environment variables: method 1: open the file to modify it, enter: mousepad / etc/profile and then modify it directly on the text. It is recommended to use this method.

Method 2: use vim / etc/profile to enter the editing state vim text editor profile global variable file Esc Shift+q into the keyboard editing Q! Do not save exit qw! Write and force exit, if keyboard x does not work

9. Reload the configuration file, enter: source / etc/profile

10. The last step is to check the installation. 1. Enter: java-version

2. Input: javac

3. Input: java

After reading the above, do you have any further understanding of how to install the JDK runtime environment in the Linux server? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report