(Simple example) Use cmd to create a folder on the desktop, and use cmd to compile and run a java program segment in this folder (detailed understanding of the cross-platform operation principle of java)

Use cmd to create a folder on the desktop, and use cmd to compile and run a java program segment in the folder **

1. Use the shortcut key win + r to open

2. Use the cd desktop command to enter the root directory (desktop)
Insert picture description here
here. You can use the dir command to view all the directories
This is all the directories under the desktop
under the desktop 3. Use md mybatis to create a folder named mybatis on the desktop (cd mybatis can be used to delete the mybatis folder)
Insert picture description here
4. Use the cd mybatis command to enter the mybatis root directory, any Use echo (java code) >> Mybatis.java (class name)
Insert picture description here

Then open the folder you created on the desktop, if
Insert picture description here
you have created a java program in the current location.
5. Run: Use the command javac Mybatis.java
Insert picture description here
and then open the mybatis file you created. You will find that there is an additional .class file.
Insert picture description here
Finally, use the command java Mybatis to run the results. Note that the class name Mybatis is not suffixed with it.
Insert picture description here

Published 9 original articles · Likes0 · Visits 797

Guess you like

Origin blog.csdn.net/Tao_Yuanqiang/article/details/90173624