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

Sample code for CSS image animation effects (photo frame)

This article introduces the sample code of CSS pi...

Use javascript to create dynamic QQ registration page

Table of contents 1. Introduction 1. Basic layout...

Vue 2.0 Basics in Detail

Table of contents 1. Features 2. Examples 3. Opti...

Basic usage of UNION and UNION ALL in MySQL

In the database, both UNION and UNION ALL keyword...

Mysql index types and basic usage examples

Table of contents index - General index - Unique ...

VUE+SpringBoot implements paging function

This article mainly introduces how to implement a...

Summary of the use of html meta tags (recommended)

Meta tag function The META tag is a key tag in th...

How many ports can a Linux server open at most?

Table of contents Port-related concepts: Relation...

MySQL date and time addition and subtraction sample code

Table of contents 1.MySQL adds or subtracts a tim...

Solution to index failure caused by MySQL implicit type conversion

Table of contents question Reproduction Implicit ...

SQL Practice Exercise: Online Mall Database Product Category Data Operation

Online shopping mall database-product category da...