This article is a mirror article of machine translation, please click here to jump to the original article.

View: 33792|Reply: 1

[Source] Centos 7 Installation Java JDK Tutorial

[Copy link]
Posted on 12/11/2018 2:32:36 PM | | | |
We use the yum command to install JDK version 1.8.

Check out the java installation package in the yum library:




Installing the JDK:



(After installation,Default installation directoryIt's at: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64)



Configure JAVA_HOME variables

Performing echo $JAVA_HOME finds that it returns empty. Note JAVA_HOME is not configured, and you need to configure the JAVA_HOME in /etc/profile.

1. Open the file that configures the environment variables



2. Add the following configuration:




:wqsave exit.

3. Make the configuration work



4. Test the configuration results


jps command cannot be found

Executing the jps command returns the error "-bash: jps: command not found"

Find jps file, command: find /-name jps, not searchable

[root@VM_0_9_centos ~]# find / -name jps
[root@VM_0_9_centos ~]# rpm -qa |grep -i jdk
copy-jdk-configs-3.3-10.el7_5.noarch
java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64

jps command requires the openjdk-devel package to be installed




Notes:

JAVA_HOMEIndicate the JDK installation path, which is the path you chose when installing just now, including lib, bin, jre and other folders (tomcat, Eclipse need to rely on this variable to run).

CLASSPATHLoad the class (class or lib) path for java, only if the class is in the classpath, the java command can recognize it, set: .:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib. CLASSPATH variable value. Represents the current directory

PATHThis allows the system to recognize java commands in any path, set to: $JAVA_HOME/bin:$JRE_HOME/bin.

Special note: There is no symbol at the end of the environment variable value, and different values are separated by : separated (used in Windows; )。





Previous:Search engine selection: Elasticsearch vs Solr
Next:How to set up zblog pseudo-static? zblog setting pseudo-static parameters explained
 Landlord| Posted on 10/9/2021 1:38:26 PM |
Centos 8 installation Java JDK tutorial
https://www.itsvse.com/thread-10108-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com