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

Installation of jdk1.8 and configuration of environment variables in Linux-like environment

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

The configuration is simple, but check it every time, just record it.

1. Pre-installation preparation

   1.1 creates an installation directory, which is usually installed in the / usr/local/jdk8 directory

Mkdir / usr/local/jdk8

   1.2 check to see if jdk has been installed, and delete the previous ones before installation.

# View echo $JAVA_HOME# through jdk environment variable view java-version through version

   1.3download installation package

Wget-no-check-certificate-no-cookies-header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz

two。 Installation

   2.1Unpack and rename

Tar-zxvf jdk-8u131-linux-x64.tar.gzmv jdk1.8.0_131 jdk1.8

   2.2.Configuring jdk-related environment variables, which need to be added with a red coil in the middle. The source command makes the configuration file effective.

Vi ~ / .bashrcexport JAVA_HOME=/usr/java/latestexport PATH=$PATH:$JAVA_HOME/binsource ~ / .bashrc   

   2.3 check whether the configuration is successful. If the jdk version number appears in java-version, the environment variables will be installed and configured successfully.

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

Servers

Wechat

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

12
Report