Home  >  Article  >  Java  >  A brief discussion on how to set up environment variables in Java

A brief discussion on how to set up environment variables in Java

青灯夜游
青灯夜游forward
2018-10-20 16:57:262663browse

This article brings you a brief discussion of how to build environment variables in Java. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Install JDK development environment

jdk download address: https://www.oracle.com/technetwork/java/javase /downloads/jdk10-downloads-4416644.html, select the corresponding version to download (Remember the installation address during the installation process, you will use later)

JDK environment variable configuration

Steps: Right-click "Computer"-> Right-click-> Properties Open the "System Panel" ”

Create a new JAVA_HOME environment variable, JAVA_HOME=C:\Java\jdk1.8.0_144

Modify the path environment variable, add %JAVA_HOME at the end of the path variable %\bin (separate with semicolon ";")

Create a new classpath environment variable, classpath=.;%JAVA_HOME%\lib;% JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\tools.jar (Note the preceding symbols ".;")

Check the java and javac commands

Enter Java or javac in cmd

If you get the above output, it means the installation is successful

The above is the detailed content of A brief discussion on how to set up environment variables in Java. For more information, please follow other related articles on the PHP Chinese website!

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