Java IDE www.espirity.com Dwight Deugo (dwight@espirity.com) Nesa Matic (nesa@espirity.com) Portions of the notes for this lecture include excerpts from.

Slides:



Advertisements
Similar presentations
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
Advertisements

Introduction to Eclipse cs112b1 – Lab01 by Rui Shi.
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Eclipse Architecture Dwight Deugo Nesa Matic
Java Integrated Development Environments: ECLIPSE Part1 Installation.
20-Jun-15 Eclipse. Most slides from: 2 About IDEs An IDE is an Integrated Development Environment.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project.
Eclipse Introduction Dwight Deugo Nesa Matic
Plug-in Development Dwight Deugo Nesa Matic
Eclipse Introduction Dwight Deugo Nesa Matic
Perspectives Dwight Deugo Nesa Matic
Eclipse Begin at the Beginning. Where to Find it:
Views Dwight Deugo Nesa Matic
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
03 Using Eclipse. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as.
Introduction to Eclipse. Overview Eclipse Background Obtaining and Installing Eclipse Creating a Workspaces / Projects Creating Classes Compiling and.
Getting started with Eclipse By Alexander Butyaev.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
Workbench Overview Dwight Deugo Nesa Matic
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
CPSC1301 Computer Science 1 Overview of Dr. Java.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
Debugging Dwight Deugo Nesa Matic
Inheritance Dwight Deugo Nesa Matic
Eclipse Eclipse An IDE is an Integrated Development Environment Different IDEs meet different needs – BlueJ, DrJava are designed as teaching.
Unit 1: Java and Eclipse The Eclipse Development Environment.
Creating and running a Java program. Eclipse Interactive Development Environment (IDE)  Eclipse is an Interactive Development Environment (IDE) for Java.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Eclipse 24-Apr-17.
Javadoc Dwight Deugo Nesa Matic
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Eclipse. An IDE is an Integrated Development Environment Different IDEs meet different needs BlueJ, DrJava are designed as teaching tools Emphasis is.
Classes Dwight Deugo Nesa Matic
Eclipse Project. Installing Visit to download a copy for your home computerhttp:// –Get Release version 3.0 (or.
Surya Bahadur Kathayat Outline  Ramses  Installing Ramses  Ramses Perspective (Views and Editors)  Importing/Exporting Example.
® IBM Software Group © 2007 IBM Corporation Module 1: Getting Started with Rational Software Architect Essentials of Modeling with IBM Rational Software.
Eclipse 27-Apr-17.
Using Ant in Eclipse Dwight Deugo Nesa Matic
Java IDE Dwight Deugo Nesa Matic
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Eclipse.
INF230 Basics in C# Programming
Development with Eclipse
Module Road Map Refactoring Why Refactoring? Examples
Introduction to Eclipse
3 Introduction to Classes and Objects.
ATS Application Programming: Java Programming
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Debugging Dwight Deugo
Chapter 3: Using Methods, Classes, and Objects
COSC-4840 Software Engineering
Important terms Black-box testing White-box testing Regression testing
Eclipse 20-Sep-18.
Important terms Black-box testing White-box testing Regression testing
Introduction to Eclipse
Some Tips for Using Eclipse
Debugging with Eclipse
Overview of Eclipse Lectures
Introduction to Eclipse
Tonga Institute of Higher Education
Eclipse Plug-in Development
Debugging Dwight Deugo
Java Looking at our first console application in Eclipse
JUnit Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from the Eclipse 3.0 and.
Debugging with Eclipse
The beginning of media computation Followed by a demo
Workshop for Programming And Systems Management Teachers
Presentation transcript:

Java IDE www.espirity.com Dwight Deugo (dwight@espirity.com) Nesa Matic (nesa@espirity.com) Portions of the notes for this lecture include excerpts from the Eclipse 3.0 and 3.1 Help facility. These excerpts are made available under EPL for ease of use by instructors, (c) Copyright (c) 2000, 2005 IBM Corporation and others. For more complete information instructors are encouraged to read the full notes from the Eclipse Help facility.

Additional Contributors None as of September, 2005

Module Overview Building and Running Java Classes In this section, we discuss how to use Eclipse to build a Java application.

Module Road Map Building and Running Java Classes Developing Java applications Projects, packages, classes Browsing Java code Searching Java code Organizing Java code Using Code Assist Running Java applications Scrapbook Let’s begin by using Eclipse to build your Java project. We will be discussing Eclipse’s Java and Java Browsing perspectives, as well as how to build and run Java applications with Eclipse.

Java Development Tooling - JDT Eclipse’s Java Development Environment is often referred to as JDT – Java Development Tooling Using the JDT you can do following with the Java programs: Write Compile Test Debug Java Development Tooling is the set of Eclipse plug-ins that allow you to write Java programs. It is fully featured Integrated Development Environment.

Perspectives When developing Java code commonly used perspectives are: Java Perspective Designed for working with Java projects Java Browsing Perspective Designed for browsing structure of Java projects Java Type Hierarchy Perspective Designed for exploring type hierarchy Debug Perspective Designed for debugging Java programs In this module we will talk about Java Perspective, Java Browsing Perspective and Java Type Hierarchy Perspective.

Java Perspective Contains: Editor area Package Explorer View Hierarchy View Outline View Problems View The Java Perspective is where you spend most of your time when developing Java code. Package Explorer View shows the Java element hierarchy of the Java projects in the Workbench. Hierarchy View shows the hierarchy of a type. Outline View displays an outline of a structured file that is currently open in the editor area, and  lists structural elements. For example an outline view for a Java class displays all fields and methods for that class. The contents of the outline view are editor-specific.

Java Browsing Perspective Contains: Editor area Projects View Packages View Types View Members View Projects View shows all projects available in the Workbench. Packages View shows all packages available for project selected in the Projects View. Types View shows all Types (classes and interfaces) from the package selected in the Package View. Members View shows all fields and methods for the type selected in the Types View.

Java Type Hierarchy Perspective Contains editor area and Hierarchy View The Java Type Hierarchy Perspective is not used as much as the other two Java perspective.

Build Path Project Preferences You can set global preferences for a project Select Window -> Preferences -> General -> Java to get Java Preferences Good idea to separate your Java files into source and compiled directories (src and bin) This action only needs to be done once Done for all subsequent projects

Creating Java Project Project used to organize resources (source, class, icons) for a project To create Java project: Select File  New  Project… from the menu The New Project wizard comes up Select Java  Java Project Click Next

New Project Wizard Specify Project Name Click Next

Java Settings Specify Java settings Click Finish Output folder (where compiled files will be stored) External jar files project depends on Classes from other projects that are referenced in the project Click Finish The Java Settings for a project is very important as you use it to set Java build path. You don’t have to set the build path at the project creation time, as at any given time you can go back to the build path through Properties for the project.

Project Properties You can change the Java build path at any time Choose Properties from the context menu while selecting the project

Creating Packages Package contains Java class files To create a package for a project: Select the src folder in the project Choose New  Package from the context menu Specify package name Click Finish

Creating Classes To create a class in a package: Select the package Choose New  Class from the context menu The Class wizard comes up Specify class details Click Finish If you specify wrong details for the class in the wizard, you can always change them later directly in the editor. When creating class Eclipse gives you an option of specifying if you would like to create a main() method for the class, or create constructors from the superclass. In the wizard you specify superclass for the class as well as modifiers (abstract, final, etc.)

Using Code Assist When activated, code assist opens a list of available code completions Code Assist activates by Crtl+Space Activates automatically when a message needs to be sent to an object (after the dot is typed) Code Assist can also be activated from the Edit menu by choosing Edit -> Content Assist. It could be customized in the Preferences window.

Using Quick Fix Useful if Java compiler shows errors Gives options for fixing the errors Activated through Edit  Quick Fix menu option Error indication Quick Fix can be used for fixing the compiling errors. In the above example type File is used for declaring field file. The error is indicated by a red rectangle on the right of the line, by red underlined name of the missing type, and by error icon on the left from the line. Quick Fix can also be activated by click on the bulb icon in the editor.

Searching for Java Classes When developing Java application a good search mechanism is very important You often search for class, method declarations, and references It is important to be able to find things quickly Eclipse Java Search mechanism is very extensive It allows you to search for: Types, methods, constructors, packages, and fields Declarations, Implementers, References In the scope of Workspace, Working Set, or Selected Resources

Organizing Java Code Eclipse comes with extensive support for organizing and refactoring Java code It is possible to: Generate getters and setters for the fields Organize missing import statements Move fields, methods, classes Rename methods, classes, packages

Generating Getters and Setters Available for creating get and set methods on the fields It supports encapsulation Activated by choosing Source  Generate Getter and Setter from the editor’s context menu Generation of getters and setters for instance variables support one of the first object-oriented principals: encapsulation. Encapsulation is that no internal state of an object should be accessed directly. This means that an internal object state should be represented through private field, and a method for accessing field should be provided. Object’s internal state is than accessed by sending a message that represents that method to object. Method for accessing object’s internal state is known as getter (get method) and method for setting object’s internal state is known as setter (set method). Usually each private field has corresponding getter/setter methods.

Refactoring Available from the Refactor context menu option in the editor Helps with refactoring Java code Allows for: Renaming Methods, fields, packages, projects, parameters, or local variables Changing of method signature Pull up a field or method (into super class) Push down a field or method (into sub class) Extract Interface (generate interface from class) Generalize type (change type of fields and methods) Refactoring is commonly used in programming and its goal is to improve the code by not affecting its functionality. You can preview all of the changes resulting from a refactoring action before you choose to actually do the changes. During the preview you will be notified of potential problems and will be presented with a list of the changes the refactoring action will perform.

Running Java Classes To Run Java application Choose Run  Run… from the menu When you open Run Dialog under Java Application are listed all classes that contain main() method, i.e. that can be run. If your class is not listed here, click on New to add all classes with main() method to this list. In the Run Dialog you can set some options before starting the Java application. You can set program and VM arguments on the Arguments page. You can also set Java Runtime Environment on the JRE page, and you can change the classpath on the Classpath page.

Console View Represents standard Java console Opens by default when standard Java output is used Can also be open from Window  Show View menu System.out.println("this is a demo");

Scrapbook… Allows for writing and executing of Java code Very useful for quick test of Java code that you write The Java code in the Scrapbook can be: Displayed as a string when evaluated Inspected when evaluated Opens an Inspector view where you can see returning object from evaluation and all containing fields Executed

…Scrapbook… It is created by selecting a project and choosing New  Other…  Java  Java Run/Debug  Scrapbook Page from the Package Explorer’s context menu and then entering the name of the page Your scrapbook page will become a resource in your project

… Scrapbook… To open the scrapbook page just click on the resource It opens up like a Java source file editor Type Java code and select the context menu to Display or Inspect

…Scrapbook Class names must be fully qualified in what you type Set imports to make life easier Think of your scrapbook as a page that Eclipse will take the source you type, wrap it in a class with your source in the main menu, then compile and execute

Summary You have learned: How to create projects, packages and classes How to browse Java code and search for Java code How to use coding assistance How to organize Java code How to run Java code How to use the Scrapbook

Labs! Lab: Building and Running a Java Application Now it’s time for the lab. Lab: Building and Running a Java Application