1. First open eclipse, right-click on the blank space on the Package Explorer bar, and select New--->Java Project
## in the menu that appears.
#2. On the interface as shown in the figure, name the project name. You can select Working set or not select it. Click Finish. At this time, the demo project is built 3. Click on the demo project, right-click on src, and select the following package option 4. Name the package name in the interface as shown, such as : com.it.test, click finish##5. Right-click on the registration and select the following options
6. After confirmation, the following interface will appear. Name the name as the name of the program, check the main method, as shown in the figure, and click finish
7. As shown in the figure, a program named test The java file is written. You can write your own program in the main method. After writing, right-click and select the following options. After confirmation, the program will compile and run. If there are no errors in the program, the running results will appear on the console. Otherwise, control The error message
#8 will appear on the station. As shown in the figure, the running result of the above simple program is 30
Recommended tutorial :
java tutorialThe above is the detailed content of How to write java program using eclipse. For more information, please follow other related articles on the PHP Chinese website!