Instructions for creating projects in eclipse (2)

Second, the creation and execution steps of the Java project

  • Click File —> New —> Java Project in the upper left cornerInsert picture description here
  • The project naming box appears after clicking Java Project, as follows:Insert picture description here
  • After the project is created, the directory structure is as follows:Insert picture description here
  • Click src —> right click —> Package to create a package for storing source filesInsert picture description here
  • After clicking Package, a box pops up to set the package name:
    Insert picture description here
  • After the package is created, create the source file: zpark —> right click —> New —> Class Insert picture description here
  • After clicking Class, a box pops up to set the original file name, as follows:Insert picture description here
  • After clicking Finish, the source file is defined, and a public class with the same name as the source file will be automatically created:Insert picture description here
  • Write the code in the source file: You can use the shortcut keys in some tools:
    Insert picture description here
  • After the source code is written, save it. If there is no syntax error, the compilation is automatically completed. The compiled .class file is saved in the bin directory of the workspace project:Insert picture description here
  • Run program: class name --> right click --> Run As --> Java Application Insert picture description here
  • After the program runs, the execution result is output on the console:Insert picture description here

Guess you like

Origin blog.csdn.net/Java_lover_zpark/article/details/105020905