Difference between revisions of "Basics : Develop Simple Apps Fedora"

From CDOT Wiki
Jump to: navigation, search
(Your First Java Program in Eclipse)
Line 1: Line 1:
 
== Your First C Program in Eclipse ==
 
== 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++. [[Image:Screenshot-3.png|thumb]]
+
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]]
  
  
Line 9: Line 10:
  
  
Your workbench is now configured for C/C++ development. [[Image:Screenshot-4.png|thumb]]
+
Your workbench is now configured for C/C++ development.
 +
[[Image:Screenshot-4.png|thumb]]
  
  
Line 19: Line 21:
  
  
Next select '''File, New, C Project''' from the main menu.   [[Image:Screenshot-5.png|thumb]]
+
Next select '''File, New, C Project''' from the main menu.
 +
[[Image:Screenshot-5.png|thumb]]
  
  
Line 29: Line 32:
  
  
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]]
+
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]]
  
  
Line 38: Line 42:
  
  
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]]
+
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]]
  
  
Line 47: Line 52:
  
  
To execute the program select '''Run As''' from the '''Run''' menu. Then select '''Local C/C++ Application'''. [[Image:Screenshot-9.png|thumb]]
+
To execute the program select '''Run As''' from the '''Run''' menu. Then select '''Local C/C++ Application'''.
 +
[[Image:Screenshot-9.png|thumb]]
  
  
Line 56: Line 62:
  
  
The output of your program is displayed in the '''Console''' window at the bottom of the workbench. [[Image:Screenshot-10.png|thumb]]
+
The output of your program is displayed in the '''Console''' window at the bottom of the workbench.
 +
[[Image:Screenshot-10.png|thumb]]
 +
 
  
  
Line 65: Line 73:
  
 
== Your First Java Program in Eclipse ==
 
== Your First Java Program in Eclipse ==
First, start by selecting the Java perspective.[[Image:j1.png|thumb]]
+
First, start by selecting the Java perspective.
 +
[[Image:j1.png|thumb]]
 +
 
 +
 
  
  
Line 72: Line 83:
  
  
 +
In the Java perspective select '''File''', '''New''', '''Java Project'''.
 +
[[Image:j3.png|thumb]]
  
  
In the Java perspective select '''File''', '''New''', '''Java Project'''. [[Image:j3.png|thumb]]
 
  
  
Line 81: Line 93:
  
  
 +
Enter your Java project name, '''FirstJavaProject''' and then click '''Finish'''.
 +
[[Image:j4.png|thumb]]
  
  
Enter your Java project name, '''FirstJavaProject''' and then click '''Finish'''. [[Image:j4.png|thumb]]
 
  
  
Line 90: Line 103:
  
  
 +
Select '''File''', '''New''', '''Class'''.
 +
[[Image:j6.png|thumb]]
  
  
Select '''File''', '''New''', '''Class'''. [[Image:j6.png|thumb]]
 
  
  
Line 99: Line 113:
  
  
 +
Now enter the name of your class, '''First''' and check the box '''public static void main(String[] args)''' and then click '''Finish'''.
 +
[[Image:j7.png|thumb]]
  
Now enter the name of your class, '''First''' and check the box '''public static void main(String[] args)''' and then click '''Finish'''. [[Image:j7.png|thumb]]
 
  
  
Line 107: Line 122:
  
  
 +
In the edit view add in your print method as shown.
 +
[[Image:j9.png|thumb]]
  
In the edit view add in your print method as shown. [[Image:j9.png|thumb]]
 
  
  
Line 116: Line 132:
  
  
 +
Your Java program is now complete.
 +
[[Image:j10.png|thumb]]
  
Your Java program is now complete. [[Image:j10.png|thumb]]
 
  
  
Line 125: Line 142:
  
  
Save your program and then select '''Run''', '''Run As''', '''Java Application'''. [[Image:j12.png|thumb]]
+
Save your program and then select '''Run''', '''Run As''', '''Java Application'''.
 +
[[Image:j12.png|thumb]]
  
  
Line 133: Line 151:
  
  
The output of your program is shown in the '''Console''' view. [[Image:j13.png|thumb]]
+
The output of your program is shown in the '''Console''' view.
 +
[[Image:j13.png|thumb]]
  
  

Revision as of 19:35, 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++.

Screenshot-3.png




Your workbench is now configured for C/C++ development.

Screenshot-4.png





Next select File, New, C Project from the main menu.

Screenshot-5.png





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.

Screenshot-7.png





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.

Screenshot-8.png





To execute the program select Run As from the Run menu. Then select Local C/C++ Application.

Screenshot-9.png





The output of your program is displayed in the Console window at the bottom of the workbench.

Screenshot-10.png




Congratulations! You've just run your first C program using Eclipse.

Your First Java Program in Eclipse

First, start by selecting the Java perspective.

J1.png





In the Java perspective select File, New, Java Project.

J3.png





Enter your Java project name, FirstJavaProject and then click Finish.

J4.png





Select File, New, Class.

J6.png





Now enter the name of your class, First and check the box public static void main(String[] args) and then click Finish.

J7.png




In the edit view add in your print method as shown.

J9.png





Your Java program is now complete.

J10.png





Save your program and then select Run, Run As, Java Application.

J12.png




The output of your program is shown in the Console view.

J13.png





Congratulations! You've just run your first Java program using Eclipse.