Home  >  Article  >  Java  >  What is the role of java environment variables

What is the role of java environment variables

WBOY
WBOYforward
2023-05-23 23:28:061754browse

1. JAVA_HOME. refers to the java installation directory. This is a rule. Whether it is oracle, tomcat or other software that needs to use jdk or jrm, you can find this environment variable directly in the operating system. Software developed by JAVA, such as Eclipse/Tomcat, finds and uses the installed JDK by searching the JAVA_HOME variable. If you do not configure the JAVA_HOME variable, you will find that Tomcat cannot start normally.

2. PATH environment variable. The function is to specify the java command search path. We need to add the bin directory under the jdk installation directory to the existing PATH variable. The bin directory contains frequently used executable files, such as javac, javaw, etc. After setting the PATH variable, you can execute tools such as javac/java in any directory. If you don't use these tools, you can only enter first.

3. CLASPATH environment variable. He tells the Java execution environment in which directories you can find the categories or packages required for the Java program you want to execute. Generally speaking, its functions are related to the import and package keywords. The java source code we write certainly contains tool categories provided by others. For example, if you write importjava.util.*, when the compiler faces the import keyword, it needs to know where the categories you introduced into java.util are. Same as above, if you don’t tell it, it will default to the current directory. How to tell it? Just set CLASPATH.

After installing the java version, we will then configure the java environment. For newbies, some of these variables need to be entered manually.

What are the basic data types of java

The basic data types of Java are divided into:

1. Integer type, used to represent the data type of integer.

2. Floating point type, a data type used to represent decimals.

3. Character type. The keyword of character type is "char".

4. Boolean type is the basic data type that represents logical values.

The above is the detailed content of What is the role of java environment variables. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete