Get ready for the 1:JDK.
Preparation 2: Environment variable configuration OK.
Preparation 3: This test is JDK8, with JDK10 in eclipse it seems to be unable to use
Meet the above three conditions, it can continue to watch
test_1: Run with package compilation
Code:
Package HelloWorld; Public class helloworld{ publicstaticvoid main (String [] args) { System.out.println ("Hello World!!!" ); }}
File Location:
compiler directive:javac-d. Helloworld.java (Note-D is followed by A. dot)
Run Result:(need to run with Java package name/file name)
After executing the java instruction, a new folder is created under the current folder, named the package XXX name in your program, here is HelloWorld
If you execute Java HelloWorld directly:
Test_2: Run without package compilation
Code:
Public class helloworld{ publicstaticvoid main (String [] args) { System.out.println ("Run without package compilation");} }
File Location:
compiler directive:Javac Helloworld.java (note: Compiled bytecode files and source files in the same directory)
Operation Result:
CMD under compile run Java program