© 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.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

The New User Interface MEDITECH Training & Education.
Copyright  Oracle Corporation, All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE.
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.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
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.
Eclipse Introduction Dwight Deugo Nesa Matic
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Lab 1 Instructor: Jolanta Soltis.
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.
With Windows 7 Comprehensive© 2012 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Windows 7 Comprehensive.
Microsoft Office 2003 Illustrated Introductory with Programs, Files, and Folders Working.
XP New Perspectives on Introducing Microsoft Office XP Tutorial 1 1 Introducing Microsoft Office XP Tutorial 1.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
Fundamentals of Java.  Explain the structure of a Java class  List and explain steps to write a Java program  Identify the benefits of NetBeans IDE.
Using Eclipse. What is Eclipse? The Eclipse Platform is an open source IDE (Integrated Development Environment), created by IBM for developing Java programs.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Introduction to Matlab & Data Analysis
With Windows 7 Introductory© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 Windows 7 Introductory Chapter 2 Managing Libraries Folders, Files.
Workbench Overview Dwight Deugo Nesa Matic
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
UCSC All rights reserved. No part of this material may be reproduced and sold. 1 IT1202-Fundamentals Of Programming (Using JAVA) Interacting with.
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Copyright © 2010 Wolters Kluwer Health | Lippincott Williams & Wilkins Introduction to Windows Chapter 2.
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
Active-HDL Interfaces Debugging C Code Course 10.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
With Windows 7 Introductory© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 Windows 7 Introductory Chapter 3 Advanced File Management and Advanced.
Unit 1: Java and Eclipse The Eclipse Development Environment.
9/2/ CS171 -Math & Computer Science Department at Emory University.
CMPF124: Basics Skills for Knowledge Workers Manipulating Windows GUI.
Topics Introduction Scene Graphs
Java Programming, Second Edition Appendix A Working with Java SDK 1.4.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Eclipse Project. Installing Visit to download a copy for your home computerhttp:// –Get Release version 3.0 (or.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Intoduction to Andriod studio Environment With a hello world program.
Module 2 Part II Introduction To Windows Operating Systems Manipulating Windows GUI Introduction To Windows Operating Systems Manipulating Windows GUI.
File and File Systems Compiled by IITG Team Need to be reorganized and reworded.
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.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Java IDE Dwight Deugo Nesa Matic
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Chapter 2 – Introduction to Windows Operating System II Manipulating Windows GUI 1CMPF112 Computing Skills for Engineers.
Dive Into® Visual Basic 2010 Express
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Eclipse.
Chapter 2: The Visual Studio .NET Development Environment
Working in the Forms Developer Environment
ATS Application Programming: Java Programming
Appendix A Barb Ericson Georgia Institute of Technology May 2006
New Perspectives on Windows XP
Using Eclipse.
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Java Looking at our first console application in Eclipse
Shelly Cashman: Microsoft Windows 10
Chapter 4 Enhancing the Graphical User Interface
Chapter 4 Enhancing the Graphical User Interface
Workshop for Programming And Systems Management Teachers
Presentation transcript:

© 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 IDE Bret Ford © 2005, Prentice Hall

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. EZJava EZJava is an Integrated Development Environment (IDE) that allows you to develop and run Java programs on a Windows, Linux, Solaris, or Macintosh OS X system. EZJava is an Integrated Development Environment (IDE) that allows you to develop and run Java programs on a Windows, Linux, Solaris, or Macintosh OS X system. Can select an appropriate look-and-feel for your system. Can select an appropriate look-and-feel for your system. Allows you to compile and run a main class along with any supporting classes in the same directory. Allows you to compile and run a main class along with any supporting classes in the same directory. Can create a project consisting of many source files within a package structure. Can create a project consisting of many source files within a package structure.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. EZJava (continued) Can open multiple editing windows in tab panes, search a file hierarchy for a pattern that can include the use of regular expressions, and run programs with a debugger. Can open multiple editing windows in tab panes, search a file hierarchy for a pattern that can include the use of regular expressions, and run programs with a debugger. Editing and printer options allow you to set fonts and tabs, execute find/replace commands, and reformat text by replacing tabs with blanks and changing cases. Editing and printer options allow you to set fonts and tabs, execute find/replace commands, and reformat text by replacing tabs with blanks and changing cases. Provides options for automatically creating program documentation and for setting paths to the class and jar files required by applications. Provides options for automatically creating program documentation and for setting paths to the class and jar files required by applications.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. EZJava (continued) New documents can be created using templates for console and GUI applications as well as applet programs and their associated HTML files. New documents can be created using templates for console and GUI applications as well as applet programs and their associated HTML files. An application executes in its own runtime window with a command button for multiple runs. An application executes in its own runtime window with a command button for multiple runs. Compiles Synchronous Java, which is an extension of Java with concurrent programming tools that are useful in an Operating Systems course. Compiles Synchronous Java, which is an extension of Java with concurrent programming tools that are useful in an Operating Systems course.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Installation Install a version of Java SDK and create a PATH entry to the bin directory of the SDK. Install a version of Java SDK and create a PATH entry to the bin directory of the SDK. Download from Download from

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Installation (continued) Windows: After uncompressing the ZIP file Windows: After uncompressing the ZIP file Double-click the batch file EZJavaInstall.bat. This brings up a self ‑ explanatory GUI application that guides you through the installation. Double-click the batch file EZJavaInstall.bat. This brings up a self ‑ explanatory GUI application that guides you through the installation.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Installation (continued) Unix: After uncompressing the ZIP file Unix: After uncompressing the ZIP file Change into the download directory and execute the command java -jar EZJavaInstaller.jar that runs the installer. Change into the download directory and execute the command java -jar EZJavaInstaller.jar that runs the installer.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Installation (concluded) OS X: Run the dmg file to mount the installation volume. Drag the EZJava icon to the Applications folder. Also, please run the registration application. OS X: Run the dmg file to mount the installation volume. Drag the EZJava icon to the Applications folder. Also, please run the registration application.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Getting Started On a Windows system, start up EZJava by selecting its icon on the desktop or the menu item in the Start Menu. The application is also available from the "EZJava IDE" group in the All Programs menu. On a Windows system, start up EZJava by selecting its icon on the desktop or the menu item in the Start Menu. The application is also available from the "EZJava IDE" group in the All Programs menu. On a Unix system, run the shell script named ezjava in the installation directory. On a Unix system, run the shell script named ezjava in the installation directory. On OS X, select the icon in the Applications folder. On OS X, select the icon in the Applications folder.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Getting Started (continued)

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Creating a Document Use the New command to create a document. In a dialog box, you can select from five options. Use the New command to create a document. In a dialog box, you can select from five options.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Creating a Document (continued) A source window is created in a tab pane. For a console application, the document includes the public main application class DemoApplication and the main() method. The class name with the extension ".java" is the default file name when you save the new document. A source window is created in a tab pane. For a console application, the document includes the public main application class DemoApplication and the main() method. The class name with the extension ".java" is the default file name when you save the new document.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Creating a Document (concluded)

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Selected Menu Options The menu bar includes familiar File, Edit, Search, Options, and Window items. The Run, Debug, and Project items have commands that organize and run the Java program. Besides the usual editing commands, EZJava has special options that support the writing of Java source code. The menu bar includes familiar File, Edit, Search, Options, and Window items. The Run, Debug, and Project items have commands that organize and run the Java program. Besides the usual editing commands, EZJava has special options that support the writing of Java source code.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Selected Menu Options (continued) The File menu item presents the standard file handling operations. In addition, a Rename command enables you to change the name of an existing file. The File menu item presents the standard file handling operations. In addition, a Rename command enables you to change the name of an existing file.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Selected Menu Options (continued) The Edit menu item contains The Edit menu item contains A Text Utilities submenu that allows you to uppercase, lowercase, or sentence case selected text. A Text Utilities submenu that allows you to uppercase, lowercase, or sentence case selected text. An option that allows you to convert between tabs and blanks to align text in a source code file. An option that allows you to convert between tabs and blanks to align text in a source code file. A Preferences item that allows the user to set the font, tab size, editor properties, printing properties, compiler and runtime options, and the look and feel which includes Metal, Motif as well as any look and feel unique to the system, such as Windows. A Preferences item that allows the user to set the font, tab size, editor properties, printing properties, compiler and runtime options, and the look and feel which includes Metal, Motif as well as any look and feel unique to the system, such as Windows.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Selected Menu Options (concluded) The Search menu item contains standard find/replace operations. In addition, a Find in Files command allows you to recursively search within a directory and its subdirectories for a word or phrase. The command Go To is useful when a runtime error message identifies the statement (with line number) that is the source of the problem. The Search menu item contains standard find/replace operations. In addition, a Find in Files command allows you to recursively search within a directory and its subdirectories for a word or phrase. The command Go To is useful when a runtime error message identifies the statement (with line number) that is the source of the problem.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Compiling and Running a Program After creating the source file, you must first compile it. The Compile operation is a command in the Run menu. You may also select an icon in the toolbar or use the keystroke command "Ctrl+K". After creating the source file, you must first compile it. The Compile operation is a command in the Run menu. You may also select an icon in the toolbar or use the keystroke command "Ctrl+K". A dialog box indicates whether any errors occur. If so, the errors are listed in the Build window. When you place the cursor over the file name in an error message, it becomes the hand cursor. A single ‑ click causes the offending line to be selected. A dialog box indicates whether any errors occur. If so, the errors are listed in the Build window. When you place the cursor over the file name in an error message, it becomes the hand cursor. A single ‑ click causes the offending line to be selected.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Compiling and Running a Program (continued)

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Compiling and Running a Program (continued) The Run command in the Run menu runs the program. You can also use an icon in the toolbar or the keystroke command "Ctrl+R". Execution brings up a runtime window with a File menu allowing you to print the text of the run and an Edit menu to copy and paste selected text. Note that if the source file is modified and not recompiled, the Run command with call the compiler and then execute the program. The Run command in the Run menu runs the program. You can also use an icon in the toolbar or the keystroke command "Ctrl+R". Execution brings up a runtime window with a File menu allowing you to print the text of the run and an Edit menu to copy and paste selected text. Note that if the source file is modified and not recompiled, the Run command with call the compiler and then execute the program.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Compiling and Running a Program (concluded) // the "DemoApplication" class public class DemoApplication { public static void main (String[] args) { System.out.println("Running DemoApplication"); }

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Setting Class Paths When converting a Java file to bytecode, the compiler must locate all of the external ".class" files that are referenced. To this end, the compiler uses a class loader. If the class is not a standard one, the loader searches the classpath which defines a list of locations where class files are stored. EZJava automates creation of the classpath. In the Run menu, select the Class Paths option. When converting a Java file to bytecode, the compiler must locate all of the external ".class" files that are referenced. To this end, the compiler uses a class loader. If the class is not a standard one, the loader searches the classpath which defines a list of locations where class files are stored. EZJava automates creation of the classpath. In the Run menu, select the Class Paths option.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Setting Class Paths (concluded)

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project In EZJava, a project is a mechanism for compiling a collection of class and interface files in a package structure, to create a jar-archive of the files, and to create javadoc HTML documentation of the files. The Project menu provides the necessary tools. In EZJava, a project is a mechanism for compiling a collection of class and interface files in a package structure, to create a jar-archive of the files, and to create javadoc HTML documentation of the files. The Project menu provides the necessary tools.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued)

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) Begin by using the command New Project to create a new project in a directory. In the example, "ProjectName.prj" is created in the directory ProjectDirectory. Begin by using the command New Project to create a new project in a directory. In the example, "ProjectName.prj" is created in the directory ProjectDirectory.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) Use the New Package command to create a directory within the project directory. You can build the package with new or existing Java source code files for classes and interfaces. Choose the Main Class menu item to associate a main application with the project. Use the New Package command to create a directory within the project directory. You can build the package with new or existing Java source code files for classes and interfaces. Choose the Main Class menu item to associate a main application with the project.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) For a project, all of the ".java" files and subdirectories (packages) are listed in a hierarchy in the Open File view. The figure in the next slide illustrates a project with a main class "MainApplication.java" in the project directory and a package called "PackageName" containing classes and interfaces. Note that the main class can also be within a package. For a project, all of the ".java" files and subdirectories (packages) are listed in a hierarchy in the Open File view. The figure in the next slide illustrates a project with a main class "MainApplication.java" in the project directory and a package called "PackageName" containing classes and interfaces. Note that the main class can also be within a package.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued)

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) The Make Project command compiles all of the Java files in the project directory and in all subdirectories. This is a "smart compile" in that only files which have been modified since the last compile are affected. The Rebuild Project command compiles all of the files in the project. The Make Project command compiles all of the Java files in the project directory and in all subdirectories. This is a "smart compile" in that only files which have been modified since the last compile are affected. The Rebuild Project command compiles all of the files in the project.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) When the Main Class command is used to select a main class, the Run Project command is operative. Like run for a single program, the command creates a runtime window which can be used for input and output. When the Main Class command is used to select a main class, the Run Project command is operative. Like run for a single program, the command creates a runtime window which can be used for input and output.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) The Utilities submenu enables you to create HTML documentation for the project, assuming you have placed javadoc comments in the source code. The resulting HTML files are created in the "docs" subdirectory of the project directory. The submenu also allows you create a "jar" file for the project class files. The Utilities submenu enables you to create HTML documentation for the project, assuming you have placed javadoc comments in the source code. The resulting HTML files are created in the "docs" subdirectory of the project directory. The submenu also allows you create a "jar" file for the project class files.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) An example illustrates a project called "MeasurementProject.prj". The file "Measurement.java" specifies an interface, and the files "Rectangle.java", "Circle.java" and "Square.java" implement the interface. The interface and implementing classes are in the package "measurement". The Java file "MeasurementDemo.java" is designated as the main class which becomes the starting point for the run of the project. An example illustrates a project called "MeasurementProject.prj". The file "Measurement.java" specifies an interface, and the files "Rectangle.java", "Circle.java" and "Square.java" implement the interface. The interface and implementing classes are in the package "measurement". The Java file "MeasurementDemo.java" is designated as the main class which becomes the starting point for the run of the project.

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued)

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) package measurement; // the interface defines the static double PI and // the prototypes for measurement operations public interface Measurement { public static final double PI = Math.PI; // return the area of the figure public double area(); // return the perimeter of the figure public double perimeter(); } Measurement.java

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (continued) import measurement.*; public class MeasurementDemo { public static void main(String[] args) { Measurement[] figure = { new Circle(5), new Rectangle(3,5), new Square(2) }; for (int i=0;i < figure.length;i++) System.out.println("Area = " + figure[i].area() + " Perimeter = " + figure[i].perimeter()); }

© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Using a Project (concluded) Run: Area = Perimeter = Area = 15.0 Perimeter = 16.0 Area = 4.0 Perimeter = 8.0