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

Analyzing the node event loop and message queue

Table of contents What is async? Why do we need a...

JavaScript implementation of classic snake game

This article shares the specific code of JavaScri...

Solution to the conflict between nginx and backend port

question: When developing the Alice management sy...

JavaScript history object explained

Table of contents 1. Route navigation 2. History ...

Q&A: Differences between XML and HTML

Q: I don’t know what is the difference between xml...

MySQL log trigger implementation code

SQL statement DROP TRIGGER IF EXISTS sys_menu_edi...

Web page creation for beginners: Learn to use HTML's hyperlink A tag

The hyperlink a tag represents a link point and i...

Implementation code for using CSS text-emphasis to emphasize text

1. Introduction In the past, if you wanted to emp...

Vue integrates PDF.js to implement PDF preview and add watermark steps

Table of contents Achieve results Available plugi...

Detailed tutorial on installing nacos in docker and configuring the database

Environment Preparation Docker environment MySQL ...

Details after setting the iframe's src to about:blank

After setting the iframe's src to 'about:b...

Detailed explanation of DOM style setting in four react components

1. Inline styles To add inline styles to the virt...

Detailed explanation of HTML tables

Function: data display, table application scenari...

Detailed analysis of MySQL master-slave replication

Preface: In MySQL, the master-slave architecture ...