Problems encountered with the environment

Configuration of environment variables:

    After installing Java , you can execute Java commands to compile Java code. The prerequisite is that you have to enter the Java installation directory to execute. ( If there is no shortcut to open qq , you must go to the installation directory of qq and execute the .exe file to open it)

    But qq I don't need to go to the directory to execute the shortcut directly. The same is true for Java . In order to facilitate the execution of Java commands at any location , Java environment variables need to be configured.

    The role of environment variables: The windows operating system executes your command in two steps. The first step is to find the executable file under your directory. If you don't find it, the second step is to find it in the environment variable. If it is found, it will be executed, and if it is not found, an error will be reported.

As long as the Java installation directory is added to the environment variable, Java commands can be executed anywhere .

How to configure: Baidu, three steps  JAVA_HOME PATH CLASSPATH

common problem:

After adding the address to PATH , use a separator ( ; ). English must be used.

    Installed JDK and configured environment variables Execute javac if there is an error.

1.  No installation  check: Enter the bin directory where you installed java and execute the javac command. If it can be displayed normally, it means the installation is correct.

2.  If there is no 1 , it must be an environment variable configuration error. Reconfigure, and do not handwrite the address, copy all.

3. For the win10 system, it is best to use the absolute path when configuring the path. If you use %JAVA_HOME%\bin; sometimes there will be problems!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324699696&siteId=291194637