Preface
Learn java forced by life
Download JDK
JAVA DEVELOPMENT KIT(JDK) = JAVA RUNTIME ENVIRONMENT(JRE) +
JAVA tools + JAVA basic library classes. ——Mr. Gu, an enthusiastic citizen
Official website https://www.oracle.com/cn/java/technologies/javase-downloads.html#JDK15
Select the JDK Download under JAVA SE 8 and
select the windows 64-bit installation package
Install JDK
Just click the next step, remember your installation path, such as:C:\Program Files\Java\jdk1.8.0_281\
Make a check after completion and use java -version
it in cmd to view the version.
Environment variable
First open: this computer -> properties -> advanced system settings -> environment variables, start editing system variables.
1) JAVA_HOME
is the JAVA installation directory, the variable value is the above installation path C:\Program Files\Java\jdk1.8.0_281\
2) PATH
creates a new one %JAVA_HOME%\bin
3) CLASSPATH
The text editor notepad++ compiles and runs java
Should I use a notepad?
First in the plug-in management, install the plug-in NppExec.
then:
If you want to execute the java file, press F6 and click OK.
reference
[1] Java download and installation and environment configuration
[2] How to compile and run Java in Notepad++
Error log
- Cannot find or load the main class. After
following [1] to complete the environment configuration, there is the following error:
I did not solve it, so when the notepad is running, there will be:
re-download. . . .