Due to the error caused by adding the package name when editing the idea, the solution:
Method 1: Edit the HelloWorld.java file with the command in the terminal, remove the package com.junyi in the first line; save:
compile it in the current directory of the HelloWorld.java file
Compile the java file:
javac HelloWorld.java
Run the compiled file:
java HelloWorld
Method 2:
Without modifying the file, move the current location to the current directory of the compiled package name, the directory where the com folder is stored, and execute the following command:
java com.junyi.HelloWorld