The javac system cannot find the path solution, the strongest environment variable configuration tutorial

Win10 installs java environment variables, javac system cannot find the path

Now many new java learners fail to install environment variables according to the tutorial on Baidu. Java can run under cmd, but javac cannot run. This is because of win10 or jdk. Follow me to
see

Let's configure environment variables with me!

First of all, we have to download a jdk
download official website, here is
the official website address, click here,
go in ,
insert image description here
find,
version you want to download
download and install , then if there is no jre
in the installed directory, if there is, ignore this step, jre is not installed by default after jdk12, you have to install it yourself

If there is no jre generation method
① Go to D disk (assuming that jdk is installed on d disk) d: Then cd to open the jdk installation directory
cd javajbk\jdk14 (run as an administrator)
How to run as an administrator is under the computer Search for cmd, then right-click to run as an administrator
②bin\jlink.exe --module-path jmods --add-modules java.desktop --output jre,
then copy the code in the second step and press Enter to generate jre
insert image description here

insert image description here)
insert image description here

insert image description here
After you have jre, you can configure environment variables. Open my computer properties like the previous Baidu tutorial.

insert image description here
insert image description here
insert image description here
Follow along and write your own jdk path later
Follow along and write your own jdk path later.
insert image description here
Configure the path and remember that win10 must use an absolute path.
Double-click to open
insert image description here
and confirm and it will be OK.
Finally configure CLASSPATH
.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools. jar;
Just copy mine and it will be OK, be careful not to forget the small dot in front
insert image description here

In this way, the configuration is complete, and it perfectly solves the problem that javac cannot run. If you don’t understand anything, you can leave a message for me.

Guess you like

Origin blog.csdn.net/BuildH/article/details/106663067