How to configure environment variables in Linux environment

How to configure environment variables in Linux environment

JDK download address:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Configure the software directory in the root directory under the Linux environment

Upload the downloaded jdk to the software folder

(The operating software I use is)

Go to the software directory.

Enter the command: cd /software

Enter the command: ll

You can see our jdk package

Unzip the file

Decompression command tar xzvf jdk-8u111-linux-x64.tar.gz

After decompression, you can delete the compressed package that was previously transferred

Delete the file rm -fjdk-8u111-linux-x64.tar.gz

Configure JDK environment variables

Similar to configuring JDK in Windows, you need to configure the following three environment variables:

vi /etc/profile and then enter the letter a or i to enter the editing state and add the following variables to the file

Enter the command to add environment variables:

export JAVA_HOME=/software/jdk1.8.0_111
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH

Enter the command to view the environment variables:

echo $CLASSPATH

echo $PATH

Enter the command to view the version of jdk

java -version

Note: Sometimes you need to restart to see these configuration information.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • A brief introduction to Linux environment variable files
  • Summary of Linux environment variable configuration methods (differences between .bash_profile and .bashrc)
  • How to configure Bash environment variables in Linux
  • Detailed explanation of Linux environment variable configuration strategy
  • A complete guide to Linux environment variable configuration
  • How to configure Java environment variables in Linux system
  • Installation and configuration of Java environment variables under Linux
  • Detailed steps for configuring environment variables in Linux
  • A brief discussion on how to modify/set the environment variable JAVA_HOME under Linux

<<:  Native JS to achieve cool paging effect

>>:  Tutorial for installing MySQL 8.0.18 under Windows (Community Edition)

Recommend

Oracle VM VirtualBox installation of CentOS7 operating system tutorial diagram

Table of contents Installation Steps Environment ...

Mysql database master-slave separation example code

introduce Setting up read-write separation for th...

js implementation of verification code case

This article example shares the specific code of ...

MySQL data backup and restore sample code

1. Data backup 1. Use mysqldump command to back u...

How to use CURRENT_TIMESTAMP in MySQL

Table of contents Use of CURRENT_TIMESTAMP timest...

How to operate MySql database with gorm

1. Setting case sensitivity of fields in the tabl...

How to build a SOLO personal blog from scratch using Docker

Table of contents 1. Environmental Preparation 2....

Detailed explanation of Mysql transaction processing

1. MySQL transaction concept MySQL transactions a...

MySQL 5.7 installation and configuration tutorial

This article shares the MySQL installation and co...

Teach you to quickly build a web cluster project based on nginx

Table of contents 1. Project Environment 2. Proje...