Home > Java > javaTutorial > How to install java environment in centos

How to install java environment in centos

WBOY
Release: 2023-05-27 13:58:06
forward
2840 people have browsed it

1. Centos description

Linux is an operating system. Centos, Fedora, and RedHat can be understood as "brands." The core of the operating systems of these "brands" are all Linux systems, but You may make some extensions and add some of your own features.

2. Installation steps

(1) First, transfer the linux version of java8 compressed package to linux via ftp On the server

(2)Create the installation directory

mkdir /usr/java/
Copy after login

(3)Extract to the installation directory

tar -zxvf jdk-8u171-linux-x64.tar.gz -C /usr/java/
Copy after login

(4)Set the environment variable

Open the file

vim /etc/profile
Copy after login

Add

export JAVA_HOME=/usr/java/jdk1.8.0_171
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
Copy after login

at the end to make the environment variable take effect

source /etc/profile
Copy after login

The above is the detailed content of How to install java environment in centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template