1 / 120

Comp 110/401 Appendix: Installing and Using Eclipse

Comp 110/401 Appendix: Installing and Using Eclipse. Instructor: Prasun Dewan (FB 150, dewan@unc.edu). Scope: Basics and Beyond. Basic use: CS 1. Beyond basic use: CS2. Download from www.eclipse.org. Extract All. Select Destination Folder. Create some kind of Shortcut for Eclipse.exe.

porter
Download Presentation

Comp 110/401 Appendix: Installing and Using Eclipse

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Comp 110/401 Appendix: Installing and Using Eclipse Instructor: Prasun Dewan (FB 150, dewan@unc.edu)

  2. Scope: Basics and Beyond Basic use: CS 1 Beyond basic use: CS2

  3. Download from www.eclipse.org

  4. Extract All

  5. Select Destination Folder

  6. Create some kind of Shortcut for Eclipse.exe

  7. Run Eclipse.exe

  8. Specify Projects Directory

  9. Remove Welcome Tab if it Appears

  10. Add a New Java Project

  11. Enter Project Name

  12. Switch to Java Perspective (May get this message)

  13. Empty Project Created

  14. Add a Package to Selected Project Select project and File Package

  15. Enter Package Name

  16. Empty Package in Non Empty Project

  17. Add a Class Select project and File Class

  18. Name the Class

  19. Empty Class in Non Empty Package

  20. Edit the File (Copy and Paste Code) packagewarmup; importjava.io.BufferedReader; importjava.io.InputStreamReader; publicclassAGreeter { staticBufferedReaderinputStream = newBufferedReader(newInputStreamReader(System.in)); publicstatic voidmain(String[] args) { System.out.println("Hello World"); if(args.length > 0) { System.out.println(args[0]); } try{ System.out.println(inputStream.readLine()); } catch (Exception e) { System.out.println("Could not read line"); e.printStackTrace(); } } } Copy and paste code from:

  21. Save (and Compile) the File FileSave or CTRL+S

  22. Workspace, Project, Source Package  Folder Project Source Package Workspace Class Source

  23. Workspace, Project, Binary Package  Folder Project Binary Package Workspace Class Object (Binary) Code

  24. Execute the Main Method on Selected Class Right MenuDebug As Java Application Can also select Run but Debug is more defensive

  25. View Output in Console Window

  26. Provide Input in Console Window

  27. The Output after Enter

  28. Supply User Argument: Right MenuDebug As Debug Configuration

  29. Select Main Class in Configuration

  30. Specify and Apply Argument in Argument Tab and Press Debug Argument must be in quotes. Args[0] = “Ca Va” Without quotes Java will make each word a separate argument (args[0] = “Ca”, args[1] = “Va”

  31. Execute with Supplied Arg

  32. Arg Printed, Program, Still Running, Waiting for Input Press Button available in both Debug and Java Perspective, only of them is active

  33. Terminated Program Inactive button

  34. Debug Last Main Launched: F11 No need to select a main class

  35. Closing a Window perhaps accidentally Hide Console

  36. Vanished Console

  37. WindowReset Perspective

  38. WindowShow View Can selectively remove and add sub-windows/views

  39. Target Basic use  Beyond basic use

  40. Create A Project from Existing Code Source Code of Class Examples Click on Zipper Directory Link in SlideShow Mode Unzip the zipped directory Make a Java project out of it by following the steps described

  41. Create a Project out of Existing Code: FileNewJava Project

  42. Uncheck Default Location Box Uncheck

  43. Enter Location and Name

  44. New Project Created But it will have errors because of missing ObjectEditor library

  45. Library Location on the Web Downloads Click on the latest version to download the jar (same as zip) and do not unzip/unjar it

  46. Download Library to Local Computer Do not unzip/unjar it

  47. Select Project, and ProjectProperties Must do this for each project!

  48. Select Build Path, Add External Jar

  49. Select Saved Jar

  50. Press Done to Commit

More Related