15 Sep Run First Program in Eclipse
In the previous lessons, we created a new Java Project, and also understood how to create new Java package and a new Java class. Now, let’s see how to run first program in Eclipse.
Launch Eclipse and reach our program, which we created in Create New Java Project lesson. We added a new project, StudyopediaProject. If you remember, we added Products.java class file in create new Java Class lesson.
We will create a simple program in Java , and add it to the java file we created before, Products.java,
1 2 3 4 5 6 7 8 9 10 11 |
package com.studyopedia; public class Products { public static void main(String args[]) { System.out.println("First program in Eclipse!!"); System.out.println("Studyopedia Eclipse Tutorial!!"); } } |
Above, we have added a simple program in Java, to print text. After adding the content, go to File and click Save.
This is how our first program looks now,
Now, to run the first program,
Go to Run menu and click it. After that, click Run sub-menu. You can also run program in Eclipse with the key, Ctrl+F11,
After running, the following output is visible, in the below Output window,
Above, we saw how to run our first Java program in Eclipse.
Support Studyopedia: DONATE
No Comments