Welcome To Eclipse. Basic Concepts Workspace – directory where your projects are stored...
-
Upload
phyllis-banks -
Category
Documents
-
view
213 -
download
0
Transcript of Welcome To Eclipse. Basic Concepts Workspace – directory where your projects are stored...
Welcome To Eclipse
Basic Concepts
• Workspace – directory where your projects are stored
– Projects• grouping of related works
– Resources• generic term to represent projects, folders, or files
• Workbench – the IDE rich client – Features
• collection of plug-ins to implement an eclipse product
– Plug-in• provides some eclipse functionality
Workbench
• Perspectives– grouping of views and editors for a
specific purpose
• Views– provide navigation or information
• Editors– provide a view for the sole purpose of
editing key elements
Workbench
PackageExplorer
Views
EditorArea
Views
(typically outline based)
Supporting Views
Java Perspective
• Lets walk thru and show– how to create a java project– how to creating a java class– how to use the auto complete– how to run our java program– how to debug our java program– how to test our java program with JUnit– how to set the preferences and settings
Slides to refresh your memory
Create a Java Project
1. File New Java Project
2. Follow the dialog screens answering the questions(call the project MyFirstProject)
Create a Java Class
1. Right click on the project and select new class from the popup menu
2. Fill in the dialogPackage: edu.cs205aa.student.learning
Class: Factorial
Select for the main method to be created.
Adding the Implementation
• Now we are already to add in the implementation for the new Factorial class
• Update the code
Creating a JUnit test
1. Right click on the class in the project explorer and add a JUnit test
2. Fill in the dialog for the testpackage: edu.cs205aa.student.learning.test
3. add the test code
Run the JUnit Test
• Run the JUnit test by selectingRun as JUnit Test
• The test failed …something is wrongwe need to debug
Debug Java Code
• Add a breakpointby right clicking on the left-hand column and “Toggling Breakpoint”
• Then run the debuggerby Debug As Junit Test
• Then you step thru the code and look at variable values, call stack, …
Finding the problem …
• Debugging the test we can determine the problem is we used an internal variable of int instead of long and we are loosing precision