[CENTOS] A memorandum of the environment variable "JAVA_HOME" path setting procedure

A memorandum of the path setting procedure for the environment variable "JAVA_HOME"

It is easy to forget the setting procedure of "JAVA_HOME", so I will show it as a memorandum.

environment

$ cat /etc/redhat-release 
CentOS Linux release 8.1.1911 (Core)

Setup steps

Check the JDK path. If it is not installed, please install the JDK accordingly.

$ dirname $(readlink $(readlink $(which java)))
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el8_1.x86_64/jre/bin

Set the JAVA_HOME path.

$ cp -pi /etc/profile{,.org}
$ vi /etc/profile
$ diff /etc/profile{,.org}
86,90d85
< 
< export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el8_1.x86_64
< export PATH=$PATH:$JAVA_HOME/bin
< export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
<
$ source /etc/profile
$ echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el8_1.x86_64

that's all

Recommended Posts

A memorandum of the environment variable "JAVA_HOME" path setting procedure
A memorandum of the FizzBuzz problem
[Java] When writing the source ... A memorandum of understanding ①
Learn the meaning of "passing the PATH" by building a Java development environment on Mac
A memorandum because I was addicted to the setting of the Android project of IntelliJ IDEA
[Beginner] Environment variable setting -dotenv-rails-
[IntelliJ] Initial setting procedure of IntelliJ
Setting the baseURL in the axios module of Docker environment Nuxt
I tried JAX-RS and made a note of the procedure
Note on the path of request.getRequestDispatcher
A memorandum of personal phpenv install
A record of setting up a Java development environment with Visual Studio Code
Is the path helper (_path) returning a relative path? Absolute pass? : Rails tutorial memorandum
How to change the value of a variable at a breakpoint in intelliJ
How to get the absolute path of a directory running in Java
Creating a Servlet in the Liberty environment
Find the difference from a multiple of 10
Procedure for introducing Docker into the development environment of existing Rails applications [Rails, MySQL, Docker]
Get the path defined in Controller class of Spring boot as a list
[When using MiniMagick] A memorandum because I stumbled in the CircleCI test environment.
Be absolutely careful when putting the result of and / or in a variable!