How to configure Java environment variables in Linux system

How to configure Java environment variables in Linux system

Configure Java environment variables

Here, the environment variables are configured in etc/profile, that is, the JDK environment is configured for all users.

sudo vi /etc/profile

Configure environment variables (note the jdk location)

#set java env
export JAVA_HOME=/usr/lib/jdk/jdk1.8.0_171
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export PATH=${JAVA_HOME}/bin:$PATH

Execute the command to make it effective:

source /etc/profile

Summarize

The above is the configuration method of Java environment variables in Linux system introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • How to set Java environment variables (graphic tutorial)
  • Basic method of installing Java and configuring environment variables on Mac OS
  • Detailed explanation of Java environment variable configuration method
  • How to set java environment variables under Windows
  • Tips for installing java and configuring environment variables under centos7
  • Tutorial on configuring Java environment variables on CentOS
  • How to configure java environment variables in Zookeeper under Windows
  • Install Java on MAC system and configure environment variables
  • The whole process of configuring Java environment variables under Win10 system

<<:  Detailed explanation of the use of Join in Mysql

>>:  jQuery achieves the effect of advertisement scrolling up and down

Recommend

Detailed explanation of how to install MySQL on Alibaba Cloud

As a lightweight open source database, MySQL is w...

MySQL Learning: Three Paradigms for Beginners

Table of contents 1. Paradigm foundation 1.1 The ...

Introduction to Linux File Compression and Packaging

1. Introduction to compression and packaging Comm...

Summary of javascript date tools

let Utils = { /** * Is it the year of death? * @r...

HTML uses the title attribute to display text when the mouse hovers

Copy code The code is as follows: <a href=# ti...

Detailed explanation of how to connect Java to Mysql version 8.0.18

Regarding the connection method between Java and ...

Record the steps of using mqtt server to realize instant communication in vue

MQTT Protocol MQTT (Message Queuing Telemetry Tra...

Web page text design should be like smart girls wearing clothes

<br />"There are no ugly women in the w...

Practical record of MySQL 5.6 master-slave error reporting

1. Problem symptoms Version: MySQL 5.6, using the...

HTML+CSS+JS realizes the scrolling gradient effect of the navigation bar

Table of contents First look at the effect: accom...