Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro to. Contents These slides describe how one can obtain (download) and use eclipse to build, run, and debug basic Java programs.

Similar presentations


Presentation on theme: "Intro to. Contents These slides describe how one can obtain (download) and use eclipse to build, run, and debug basic Java programs."— Presentation transcript:

1 intro to

2 Contents These slides describe how one can obtain (download) and use eclipse to build, run, and debug basic Java programs.

3 Windows, Mac, and Linux – Download from http://www.eclipse.org/downloads/ http://www.eclipse.org/downloads/

4 1. Create a new Java Project

5 2. Specify the new for the new project

6 The package explorer indicates success!

7 3. Next we need to create a class that will contain main.

8 We’ll create the class that contains main. (eclipse will generate main and javadoc comments for us, if we wish.)

9 Here’s the result!

10 eclipse can even help us when we forget!

11

12 Editing programs Use spaces instead of tabs. – Default is to use tabs. – Change eclipse to use spaces instead (of tabs). – Window->Preferences->Java->Code Style- >Formatter New… to create a new profile. Edit… Change Tab policy to Spaces only. Then select all of your code, and then select Source- >Format to convert existin tabs to spaces.

13 Running your program. 1.Before you attempt to run your new program you must click on it in Package Explorer first to select it. (At least that’s what I do when I have more than one package/program.) 2.Or simply right-click on it in the Package Explorer.

14 1a. Select your package.

15 1b. Choose Run from the Run menu.

16 Indicate if it’s a Java application (or applet), if asked.

17 Program ran. See output below.

18 2a. Alternatively, right-click on your package and choose run.

19 debugging Right-click in margin (next to the line we wish to break at) to toggle break point, and choose Toggle Breakpoint.

20 Choose Toggle Breakpoint.

21 Breakpoint is now set.

22 Choose Debug from the Run menu to start program execution (stopping at the breakpoint).

23 Program execution has paused at (right before) breakpoint. Pick an option from the Run menu to continue (or stop debugging).

24 CHANGING FROM THE DEBUGGING PERSPECTIVE TO THE JAVA PERSPECTIVE.

25 eclipse and perspectives “In the Eclipse Platform a Perspective determines the visible actions and views within a window. Perspectives also go well beyond this by providing mechanisms for task oriented interaction with resources in the Eclipse Platform, multi-tasking and information filtering.” – http://www.eclipse.org/articles/using- perspectives/PerspectiveArticle.html http://www.eclipse.org/articles/using- perspectives/PerspectiveArticle.html

26

27


Download ppt "Intro to. Contents These slides describe how one can obtain (download) and use eclipse to build, run, and debug basic Java programs."

Similar presentations


Ads by Google