This cheat sheet shows you how to create a "Hello World" application that uses the Standard Widget Toolkit (SWT). The application will simply display an empty window to the user.
1. Create a java project:
Before creating a class, we need a project to put it in. In the main toolbar, click on the New Java Project button,
or click on the link below. Enter HelloWorld for the project name, then click Finish.
2. Create your HelloWorld class:
The next step is to create a new class. In the main toolbar again, click on the New Java Class button (or the link below). If not already specified, select HelloWorld/src as the source folder. Enter HelloWorld for the class name, select the checkbox to create the main() method, then click Finish.
The Java editor will automatically open showing your new class.
3. Add a print statement:
Now that you have your HelloWorld class, in the main() method, add the following statement:
System.out.println("Hello world!");
Then save your changes; the class will automatically compile upon saving.
4. Run your java application:
To run your application, right-click on your class in the Package Explorer and select Run As > Java Application. The Console view should appear at the bottom and display the "Hello, world!" output.
Congratulations! You have successfully created a Hello World application!
Постоянный адрес статьи в Интернет: http://www.ispl.ru/Eclipse_HelloWorld_eng.html
Key words: eclipse, java, helloworld, hello, world, project, class, application
Make yourself
Main
(C) L.Tochilov