Presentation is loading. Please wait.

Presentation is loading. Please wait.

The eclipse IDE IDE = “Integrated Development Environment”

Similar presentations


Presentation on theme: "The eclipse IDE IDE = “Integrated Development Environment”"— Presentation transcript:

1 The eclipse IDE IDE = “Integrated Development Environment”
Contains all the utilities needed to write, build, test, and publish source code Has deep integration with specific programming languages Can detect errors before they occur Helps maintain good documentation for your code, and provide easy-to-access references To set up eclipse: Start program Designate ”workspace” folder – this will contain all your different projects

2 Your to-do list Shows the source file you are currently editing Shows your project files Code outline Shows errors and text output

3 To start coding: Right-click in the “Package Explorer” pane and select “New” > “Java Project” Alternative, navigate from the “File” menu

4 Name your project “HelloWorld”
Click “Finish” button

5 Create a new source file
Right click or go to “File” menu Navigate to “New” -> “Class”

6 Create a new source file
Right click or go to “File” menu Navigate to “New” -> “Class” Name your class “HelloWorld” Leave other options as default Click “Finish”

7 Create a new source file
Right click or go to “File” menu Navigate to “New” -> “Class” Name your class “HelloWorld” Leave other options as default Click “Finish”

8 public class HelloWorld { } Notes:
What you see now: A file called “HelloWorld.java” Contains text: public class HelloWorld { } Notes: In Java, every file contains one “Class” Denoted by the keyword “class” The name of the file must match exactly one “public” class defined in the top-level of the file You can define more public and private classes within that class though (more later) The keyword “public” is special, and means that this class can be referenced from outside the file The braces { and } together create a block of code The class name must must proceed a code block (even an empty one, as above)

9 Edit “HelloWorld.java” to contain:
Be careful! (Almost) every single character matters Case-sensitive! /** * The HelloWorld class prints “Hello, World!” * to the console. */ public class HelloWorld { public static void main( String[] args ) { System.out.println(“Hello, World!”); }

10 Your first program!

11 Run you program! Click the “Run” button at the top, or “Run As” -> “Java Application”

12 Program Output Check your console at the bottom
Text output, if any, appears here Compile errors will appear here as well

13 Program Errors IMPORTANT RULES
Declarations and expressions must end in semicolons (;) Capitalization matters Braces, parentheses, brackets must be matched Demo: try removing the semicolon from line 7 of your program Run the program What happens?

14 Compile Error! When you try and run without the proper syntax (code structure) the compiler will halt with an error message Tells you the line where the error was detected HelloWorld.java:7 Eclipse is smart enough to detect this error before you compile, though Standard text editors could not do this!


Download ppt "The eclipse IDE IDE = “Integrated Development Environment”"

Similar presentations


Ads by Google