JAVA- installation environment

This blog main point is that Windows and Linux configuration Java environment variables.
Java environment installed many times, but each time feeling more or less need to Baidu under, that may not be justice. So with this blog, take advantage of the opportunity to become familiar with the Java environment.

Environment Variables Description

Environment variables are used to specify system operating parameters operating system environment, such as the temporary folder location and location system folder.

There are two Windows environment variables, one system variables, one is user variable.
The system variables are not related to the user name, user variables involve the user name
key difference is: the system environment variable for all users of a computer is valid, the user variable is only valid for this login windows user name.

Java Environment Variables

After we installed the jdk, so generally increase three elements in the environment variable: JAVA_HOME, PATH, CLASSPATH.

JAVA_HOME: its value is filled jdk installation directory, to find bin, lib and other directories in this path. After To use this path, just type% JAVA_HOME% can be.
PATH: Specifies the java command search path, you need to install jdk bin directory under the current directory to the PATH variable, bin directory contains often use executable files, such as javac, etc., set up after the PATH variable, you can execute javac / java and other tools in any directory.
CLASSPATH: It tells the Java runtime environment, Java programs can be found to perform the required class or package in which directories. Import is usually used, package related keywords. If not specified, the default look for in the current directory, how to tell him, is to use CALSSPATH environment variable.
jdk download link

Windows

2012 Windows
Jdk13.0.1 64 place

From the start configuration environment variable:
    1 在系统变量中,创建JAVA_HOME变量,值是jdk的安装目录,比如 C:\Program Files\Java\jdk-13.0.1 (默认路径)
    2 创建CLASSPATH,值是.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar(注意最前面有一点),这个tools.jar是由Java语言的import机制和jar机制决定的,具体请自行百度。
    3 编辑Path,把值放到最前边 %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; 放在哪都行,注意分割就好了。

If the installation before the start cmd, and then use cmd restart after installation java -versionto see if the configuration is successful.
Reference links:
https://www.cnblogs.com/iceb/p/7561752.html
https://www.cnblogs.com/heartwarming/p/10372678.html
https://www.cnblogs.com/qiaoweiwei/p /9967710.html

Linux

. 7 CentOS
JDK-13.0.1_linux-x64_bin.tar.gz
the Linux is disposed in / etc / profile file. This document relates to a system environment where all users will modify work, the specific content of all your own review.

centos default is Java, is the slightly older version may be a little. To install a new, first of all want to uninstall the old version of the swap.
Use rpm -e | grep javaview
using the rpm -e --nodeps [jdk名称]uninstall
uninstall is complete, java -version not take effect
vim to open the / etc / profile file, add at the end

    JAVA_HOME=/home/centos/Desktop/jdk-13.0.1 #这个路径是个人jdk的目录
    JRE_HOME=/${JAVA_HOME} 
    CLASSPATH=.:{JAVA_HOME}/libss:${JRE_HOME}/lib #注意,这个点后面是冒号
    PATH=${JAVA_HOME}/bin:$PATH

In jdk8 is a jre folder, but JDK13 the new version, not only comes with jdk jre, and melt into the jdk jre components, all JRE_HOME directly to JAVA_HOME on it.
Save and exit, use source /etc/profiletake effect after overloading.
Reference Links:
https://www.jb51.net/article/171821.htm

Guess you like

Origin www.cnblogs.com/Smoke-star/p/12128557.html
Recommended