Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project.

Slides:



Advertisements
Similar presentations
Automated Unit Test Package For Tcl Procedures March 25, 2017
Advertisements

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.
Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
Java Integrated Development Environments: ECLIPSE Part1 Installation.
Integrated Development Environments. Today We Will: Go over more advanced functionality of Eclipse. Break up into teams to work on presentation and final.
Fall 2007CS 2251 Programming Tools Eclipse JUnit Testing make and ant.
20-Jun-15 Eclipse. Most slides from: 2 About IDEs An IDE is an Integrated Development Environment.
Eclipse Begin at the Beginning. Where to Find it:
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Views Dwight Deugo Nesa Matic
Enhancing Developer Productivity using Eclipse Presented by: Tom Sausner.
Software Development COMP220/COMP285 Sebastian Coope Eclipse and Java These slides are mainly based on “Java Development with Eclipse” – D.Gallardo et.
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.
INF 111 / CSE 121 Discussion Session Week 2 - Fall 2007 Instructor: Michele Rousseau TA: Rosalva Gallardo.
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
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.
Using Eclipse. What is Eclipse? The Eclipse Platform is an open source IDE (Integrated Development Environment), created by IBM for developing Java programs.
Arc: AddIns Dr Andy Evans. Java Direct access to ArcObjects Framework inside and outside Arc. Ability to add components to the GUI. Ability to communicate.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Author: Loh Jianxiong Christopher Editors: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang.
1 Development Environments AUBG, COS dept Lecture Title: Dev Env: Eclipse (Extract from Syllabus) Reference:
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
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
OCC Network Drives  H:\  P:\ 
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Introduction to Android (Part.
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.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse debugger.
Eclipse 24-Apr-17.
Eclipse and JUnit. Eclipse Terms The Workbench Perspective –Collection of editors and views –Exampes: Java Pers., Debugging Persp. Editors (create a file)
Eclipse. An IDE is an Integrated Development Environment Different IDEs meet different needs BlueJ, DrJava are designed as teaching tools Emphasis is.
Development with Eclipse Software Engineering Prof. Werner Krandick.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 What we'll cover here l Using the debugger: Starting the debugger Setting.
Eclipse Project. Installing Visit to download a copy for your home computerhttp:// –Get Release version 3.0 (or.
Author: Loh Jianxiong Christopher Contributions: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang, Tong Chun Kit, Tania Chattopadhyay.
® IBM Software Group © 2007 IBM Corporation Module 1: Getting Started with Rational Software Architect Essentials of Modeling with IBM Rational Software.
Introduction to Eclipse Programming with an Integrated Development Environment.
Intro to. Contents These slides describe how one can obtain (download) and use eclipse to build, run, and debug basic Java programs.
Intoduction to Andriod studio Environment With a hello world program.
------TAO, MARKUS Project IT. JavaDoc ‣ JavaDoc is a standard method of commenting source code (interfaces, classes, methods, instances variables). ‣
Eclipse 27-Apr-17.
1 1 1 Introduction to Java. 2 History of Java Java – Originally for intelligent consumer-electronic devices – Then used for creating Web pages with dynamic.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Java IDE Dwight Deugo Nesa Matic
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Eclipse.
The eclipse IDE IDE = “Integrated Development Environment”
ATS Application Programming: Java Programming
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Eclipse Navigation & Usage.
Eclipse 20-Sep-18.
Some Tips for Using Eclipse
Test-Driven Development
Introduction to JUnit IT323 – Software Engineering II
Using Eclipse.
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Test-Driven Development
Java Looking at our first console application in Eclipse
CMPE212 – Reminders Assignment 2 due today, 7pm.
Workshop for Programming And Systems Management Teachers
Presentation transcript:

Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project

3-2 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works What we'll cover here  The JDT environment  Creating and running a program  Automating testing with JUnit  Using Ant and javadoc

Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The JDT environment

3-4 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works The Java Development Tools  A set of tools for writing, compiling, testing, and debugging Java code.  Note: Compiling happens automatically whenever you save your code. It's not a separate step.  The Eclipse SDK includes the Java tools. See eclipse.org/jdt if you want to learn more about the project.

3-5 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works JDT perspectives  The most useful perspectives for Java development are Java and Debug.  There are also the Java Browsing and Java Type Hierarchy perspectives.  We'll look at the Java perspective now; we'll cover the Eclipse Debugger later.

3-6 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works The Java perspective Syntax-aware Java editor Class hierarchy Class outline

3-7 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works The Java editor  As you'd expect from a world-class IDE, Eclipse has a color-coded Java editor.  As you type, it automatically highlights the Java syntax and indents your code.  If there are errors, they're indicated when you save the file (if not before).

3-8 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works The Java editor

3-9 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Code assist  If you type Ctrl+Space, Eclipse shows you the relevant method signatures and the javadoc for each.  This works for code you write as well as the standard Java libraries.  You don't have to run javadoc against your code for this to work. The documentation above comes from the comment in the source code.

3-10 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Globalization  Eclipse has an "Externalize Strings" function that helps you manage translation or localization of your projects.

3-11 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Other great features  Generate getters and setters automatically  "Quick Fix" certain problems  Automatically organize import statements  Add imports as necessary, remove unused imports, specify which imports are used  Refactoring code  Rename classes, methods, fields  Create an interface from a class  Move classes, methods, fields

Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating and running a program

3-13 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating and running code  It's a short process: 1.Create a Java project 2.Create a Java package 3.Create a Java class in that package 4.Set up a run configuration 5.Run your code This can be confusing to newcomers; compiling and building is not a separate step.

3-14 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a Java project  Start with File  New  Project…  Choose Java Project, give it a name and click Finish.

3-15 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a Java Project  If you click Next after you give your project a name, you'll see other options. You can use these to set the classpath of your project, among other things.

3-16 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a Java package  To create a Java package, right-click on your new project in the Package Explorer, then choose New  Package…

3-17 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a Java package  Enter a name for your package.  If you break Java style rules (maybe your package begins with an uppercase letter), Eclipse reminds you.

3-18 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a Java package  Your new package appears in the Package Explorer beneath your project.

3-19 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a Java class  To create a Java class, right-click on your new package in the Package Explorer, then choose New  Class.

3-20 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a Java class  Enter a name for your class.  Eclipse reminds you of style rules here as well.  You can set the details of your class, including its superclasses, visibility and interfaces.

3-21 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a Java class  Your new class appears in the Package Explorer beneath your package.  Eclipse also opens the source file for your class in the Java editor.

3-22 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works A shortcut  You can create a new package and a new class at the same time.  Simply create a new class and enter a new package name in the wizard.

3-23 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Running your code  To run your code, right-click on the Java file, then choose Run As  Java Application.

3-24 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Running your code  Because this is a console application (it uses System.out.println ), you'll see the output in the Console view. System.outin blackSystem.err in redSystem.inin green  By default, System.out is displayed in black, System.err is displayed in red and System.in shows up in green.  If the Console doesn't appear, you can open it through Window  Show View…

3-25 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Re-running your code  Once you've run your code, a reference to it appears in the Run menu. You can click your program's name in the Run History menu to run it again.  Run Last Launched (Ctrl+F11) does the same thing.

3-26 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating a run configuration  In some cases you need a run configuration.  This lets you set command-line parameters, JVM options, etc.  Select your project in the Package Explorer, then choose Run  Run…

3-27 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Scrapbook pages  You can create a scrapbook page with the Java tools. A scrapbook page lets you enter and execute lines of Java code without building a class to hold them.  The wizard to create a new scrapbook page is under New  Java  Java Run/Debug.

3-28 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Scrapbook pages  You can highlight some code, right-click on it, then choose Inspect, Display or Execute.  Our sample code here is System.out.println ("Here's the value of PI: " + Math.PI);  If you choose Execute, the selected code is executed. In this example, we've highlighted the entire line of code; executing it writes to the console.

3-29 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Scrapbook pages  If you choose Inspect, the scrapbook page shows you the value of whatever you've highlighted.  In this example, we've only highlighted Math.PI, not the whole line of code.  Display inserts the value of whatever you've highlighted.

Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Automating testing with JUnit

3-31 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Automating testing with JUnit  JUnit was created by programming legends Kent Beck and Erich Gamma.  It makes it easy to implement Test-Driven Development (TDD), (sometimes called Test First Development).  Eclipse has JUnit support built in.

3-32 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating test cases  Right-click on a Java file and choose New  Other…

3-33 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating test cases  Select Java/JUnit on the left and TestCase on the right, then click Next.

3-34 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating test cases  When you create a JUnit test case, you name the test case (it's a Java class) as well as the Java class tested by the test case.

3-35 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating test cases  Eclipse gives you a list of all the public methods in your class and its superclasses. You decide which ones should be part of the JUnit test class.

3-36 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Creating test cases  In this example, we ask Eclipse to generate a JUnit TestCase for the getGreeting() method.  The complete testGetGreeting() method is: public void testGetGreeting() { HelloWorld hw = new HelloWorld(); assertEquals("Hello, World!", hw.getGreeting()); }  We're saying that getGreeting() should always return the string " Hello, World! "

3-37 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Running test cases  Our test case is the Java class TestHelloWorld.  To run the class, select the test class in the Package Explorer, then choose Run As  JUnit Test.

3-38 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Running test cases  The results of running your test case appear in the JUnit view.  Green is good…  You can also create and run JUnit TestSuite s. A TestSuite is an ordered collection of TestCase s.

3-39 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using JUnit  You define more TestCase s and TestSuite s as your project progresses.  You run the JUnit tests to make sure any changes you've made haven't broken your code.

Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Using Ant and javadoc

3-41 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using Ant  Ant ( ant.apache.org ) is an XML- and Java-based build tool.  Designed to have the same functionality as make without its quirks  You don't need a tab character at the start of each line, for example.  You can extend Ant to do other tasks if you want.

3-42 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using Ant  An Ant build file (named build.xml by default) can define a number of targets.  You can define which target gets built from the command line (or the Eclipse equivalent), or let Ant figure out which one should be created.

3-43 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using Ant  Once you've created your build.xml file (or whatever you choose to call it), you can right-click on it and choose Run Ant…

3-44 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using javadoc  You can export your project to javadoc.  When you do this, Eclipse runs javadoc against your code and exports the generated files to the directory you choose.

3-45 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using javadoc  When you generate the javadoc s, you specify which packages and classes should be processed.  You can also decide which class members are processed (public, protected, private)

3-46 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using javadoc  You can customize the files that are generated, such as index pages or navigation bars.  If you want, you can create links to the standard Java libraries.

3-47 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using javadoc  The generated documentation is put in the docs folder of your project by default.

Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Summary

3-49 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Summary  We've covered (although very quickly) the Java development functions in Eclipse, including:  Various automatic coding features  How to create and run Java code  Automating testing with JUnit  Using ant and javadoc inside Eclipse