Difference between revisions of "Basics : Develop Simple Apps Fedora"
(→Your First Java Program in Eclipse) |
(→Your First C Program in Eclipse) |
||
Line 2: | Line 2: | ||
The first thing you have to do is to select the C/C++ perspective. You can do this by clicking the icon pointed to by the red arrow and selecting C/C++. | The first thing you have to do is to select the C/C++ perspective. You can do this by clicking the icon pointed to by the red arrow and selecting C/C++. | ||
− | [[Image:Screenshot-3.png|thumb]] | + | [[Image:Screenshot-3.png|left|thumb]] |
Line 11: | Line 11: | ||
Your workbench is now configured for C/C++ development. | Your workbench is now configured for C/C++ development. | ||
− | [[Image:Screenshot-4.png|thumb]] | + | [[Image:Screenshot-4.png|left|thumb]] |
Line 22: | Line 22: | ||
Next select '''File, New, C Project''' from the main menu. | Next select '''File, New, C Project''' from the main menu. | ||
− | [[Image:Screenshot-5.png|thumb]] | + | [[Image:Screenshot-5.png|left|thumb]] |
Line 33: | Line 33: | ||
Enter the name of your project, '''FirstCProject''', and for the executable type select '''Hello World ANSI C Project''', and then click on the '''Finish''' button. | Enter the name of your project, '''FirstCProject''', and for the executable type select '''Hello World ANSI C Project''', and then click on the '''Finish''' button. | ||
− | [[Image:Screenshot-7.png|thumb]] | + | [[Image:Screenshot-7.png|left|thumb]] |
Line 43: | Line 43: | ||
Notice that you now have a simple Hello World program in the editor window. If you like you may make a small change to the program and save it or you can just leave it as is. | Notice that you now have a simple Hello World program in the editor window. If you like you may make a small change to the program and save it or you can just leave it as is. | ||
− | [[Image:Screenshot-8.png|thumb]] | + | [[Image:Screenshot-8.png|left|thumb]] |
Line 53: | Line 53: | ||
To execute the program select '''Run As''' from the '''Run''' menu. Then select '''Local C/C++ Application'''. | To execute the program select '''Run As''' from the '''Run''' menu. Then select '''Local C/C++ Application'''. | ||
− | [[Image:Screenshot-9.png|thumb]] | + | [[Image:Screenshot-9.png|left|thumb]] |
Line 63: | Line 63: | ||
The output of your program is displayed in the '''Console''' window at the bottom of the workbench. | The output of your program is displayed in the '''Console''' window at the bottom of the workbench. | ||
− | [[Image:Screenshot-10.png|thumb]] | + | [[Image:Screenshot-10.png|left|thumb]] |
Revision as of 19:40, 18 January 2011
Your First C Program in Eclipse
The first thing you have to do is to select the C/C++ perspective. You can do this by clicking the icon pointed to by the red arrow and selecting C/C++.
Your workbench is now configured for C/C++ development.
Next select File, New, C Project from the main menu.
Enter the name of your project, FirstCProject, and for the executable type select Hello World ANSI C Project, and then click on the Finish button.
Notice that you now have a simple Hello World program in the editor window. If you like you may make a small change to the program and save it or you can just leave it as is.
To execute the program select Run As from the Run menu. Then select Local C/C++ Application.
The output of your program is displayed in the Console window at the bottom of the workbench.
Congratulations! You've just run your first C program using Eclipse.
Your First Java Program in Eclipse
First, start by selecting the Java perspective.
In the Java perspective select File, New, Java Project.
Enter your Java project name, FirstJavaProject and then click Finish.
Select File, New, Class.
Now enter the name of your class, First and check the box public static void main(String[] args) and then click Finish.
In the edit view add in your print method as shown.
Your Java program is now complete.
Save your program and then select Run, Run As, Java Application.
The output of your program is shown in the Console view.
Congratulations! You've just run your first Java program using Eclipse.