Java and Project Delivery E&CE 250 Winter 2002

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 4 Writing Java Applications, Java Development Tools.
Advertisements

Introduction to Java 2 Programming Lecture 3 Writing Java Applications, Java Development Tools.
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Foundations of Programming and Problem Solving Introduction.
Introducing Java CSC1401. Course Goals Teaching programming concepts In a “real” language.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Dale Roberts Introduction to Java - First Program Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
JDK, Jan Pettersen Nytun - HiA 1 The Java Programming Environment: The programmer write source code with a text editor. The programmer write source code.
1 Introduction to Java and Applet. 2 Download Java Compiler (1)
Introduction to Java Programming, 4E
Using Java without BlueJ Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling BlueJ projects A BlueJ.
Introduction to Java A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
Applying OO Concepts Using Java. In this class, we will cover: Overriding a method Overloading a method Constructors Mutator and accessor methods The.
Introduction to Java.
Introduction to the JDK Java for Computational Finance
PHY281Introduction to JavaSlide 1 Introduction to Java In this section we will learn how how to use Java and write our first Java Applet:  The Java Development.
Developing User Interfaces (DUI) Chris North cs3724: HCI.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
S.W. Ma/CIM/LWL41211/2 Prog. IIA Page 1 HKIVE (Lee Wai Lee Campus) Department of CIM Course : Year 2 Module : Programming IIA Textbook : Introduction.
UNCLASSIFIED User Guide Applicant. UNCLASSIFIED Table of Contents What is the SAFETY Act? Applicant Guide Help Desk.
(C) 2010 Pearson Education, Inc. All rights reserved.  Java programs normally go through five phases  edit  compile  load  verify  execute.
Javadoc. The Plan ● What is Javadoc? ● Writing Javadoc comments ● Using the Javadoc tool ● Demo ● Practice.
Nancy Severe-Barnett Program Coordinator, SCIS
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
© 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.
The Basics of Javadoc Presented By: Wes Toland. Outline  Overview  Background  Environment  Features Javadoc Comment Format Javadoc Program HTML API.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Putting Applets into Web Pages.  Two things are involved in the process of putting applets onto web pages ◦ The.class files of the applet ◦ The html.
Java Spring PImage Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What.
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
1 ITI 1120 Lab # 1 An Introduction to the Lab Environment Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot.
POS 406 Java Technology And Beginning Java Code
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Board Activity Find your seat on the seating chart Login – Remember your login is your first initial your last name and the last three numbers of your.
Introduction to Java Programming with Forte Y. Daniel Liang.
CPSC1301 Computer Science 1 Overview of Dr. Java.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
The Joy of Programming (also known as) Introduction to Object-Oriented Programming.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Introduction to Java Programming. Introduction Course Objectives Organization of the Book.
Object Oriented Programming Lecture 3. Introduction  In discussing Java, some items need to be clarified  The Java programming language  The Java virtual.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Preliminaries CS 310: Object-oriented Programming Java API.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
EIE375 BlueJ: Getting Started Dr Lawrence Cheung.
Creating Programs on UNIX This term you can create programs on UNIX or you can create programs using a C++ compiler on your PC. This set of slides steps.
Java Methods Methods contain a group of instructions that together perform a single task. For example if I want to perform the task of “making a pizza”,
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
A brief introduction to javadoc and doxygen. What’s in a program file? 1. Comments 2. Code.
Lecture 2 February 3, Installing PFE Just unzip the file you download into any directory, such as C:\Program Files\PFE You may right-click on pfe32.exe.
CIS Intro to JAVA Lecture Notes Set July-05 GUI Programming –TextField Action Listeners, JEditorPane action listeners, HTML in a JEditorPane,
Creating a Java Application and Applet
CPRG 215 Introduction to Object-Oriented Programming with Java Module 1-Introduction to Java Topic 1.3 Write Your First Java Program Produced by Harvey.
In this class, we will cover: Overriding a method Overloading a method Constructors Mutator and accessor methods The import statement and using prewritten.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Introduction to Java Programming, 4E Y. Daniel Liang.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Introduction to javadoc
Applying OO Concepts Using Java
Introduction to javadoc
Review of Previous Lesson
Workshop for Programming And Systems Management Teachers
Presentation transcript:

Java and Project Delivery E&CE 250 Winter

Java on Polaris We are using the Java 2 Version 1.3 SDK java -version It provides the following tools: javac java javadoc jar jdb appletviewer The compiler for the Java programming language The launcher for Java applications API document generation Creation and management of Java Archive files The Java Debugger The launcher for Java applets

Setting up 1.Log onto Polaris 2.Open the MS-DOS prompt from Windows 3. Create a ece250 directory in n:\ n:\ mkdir ece Edit n:\privexec.bat and add the lines: set PATH=%PATH%;q:\eng\ece\jdk1.3\bin set CLASSPATH = N:\ece Run the batch file n:\privexec.bat again

Java program: StringOperations Use any text editor you like Enter the following program: public class StringOperations { public static void main (String[] args) { String str = “If there were dreams to sell, What would you buy?”; System.out.println (“The string is: ” + str); System.out.println (“The length is: ” + str.length()); System.out.println (“Substring 14-20: ” + str.substring(14,20)); System.out.println (“Uppercase is: ” + str.toUpperCase()); } Save the program as StringOperations.java in your n:\ece250 directory

Compile the program Open the MS-DOS prompt and change your directory: n:\> cd ece250 Now compile the program: n:\ece250> javac StringOperations.java If everything works, you’ll get no messages back Check to see if a StringOperations.class file has been created. n:\ece250> dir *.class Note: For a Java program to compile properly, the name of the file and class defined must be the same. Remember: file name = class name.

Run the program Now run the program: n:\ece250> java StringOperations If it works, you’ll see: The string is: If there were dreams to sell, What would you buy? The length is: 49 Substring 14-20: dreams Uppercase is: IF THERE WERE DREAMS TO SELL, WHAT WOULD YOU BUY? If it fails, you’ll probably see: Exception in thread “main” java.lang.NoClassDefFoundError: StringOperations This will happen if you forgot to set the classpath to include your working directory.

javadoc A brief introduction to javadoc: –The purpose of this tool is to automatically generate HTML documentation from your.java source files. –You can run Javadoc on individual.java files, or.jar files –A comment must be added before the section it is commenting

The documentation is created by adding special tags in your.java files. These tags enable you to document your source code. The tags start with an "at" sign and are case-sensitive (they must be typed with the lowercase letters as shown) Some common javadoc

/** * The StringOperations class represents manipulation of strings Ricardo Rolon 1.0, Sep 2001 */ public class StringOperations { /** * Creates a String object. */ public static void main (String[] args) { String str = “If there were dreams to sell, What would you buy?”; System.out.println (“The string is: ” + str); System.out.println (“The length is: “ + str.length()); System.out.println (“Substring 14-20: “+ str.substring(14,20)); System.out.println (“Uppercase is: “ + str.toUpperCase()); } javadoc Example Javadoc -author -version StringOperations.java

Jar files The jar tool allows you to create archives, similar to a.zip archive. (In fact, they are based on ZIP compression) There are several reasons we want to do this: –easier to transfer (compressed files = less time over a network) –easier to execute (all the.class files are in the.jar, makes only one connection to the server) –jar’s can be signed by the author (security) –can store additional files like.html, readmes, etc.

Jar files Example: jar cvmf myManifestFile myJarFile *.class *.html *.java Where c option indicates that a jar file must be created, v means to be Verbose m include my own Manifest file f put the.jar file in a separate File whose name is provided The Java Virtual Machine needs to know which.class file in the.jar file contains the main( ) method. To do that, create a text file with just one line: Main-Class: For instance, in Project 1, if Rational.class is the class that contains main(), then MyManifestFile should contain the following line: Main-Class: Rational Don’t forget to end the Main-Class line with a carriage return, otherwise jar will not recognize it.

jdb (java debugger) Compile the program with the -g option (extra class info) Start jdb java debugger Set breakpoints Run program Experiment with debugger commands: –list -- Displays the source code of the line and several lines around it –locals -- List the values of local variables that are currently in use –print -- Display the value of the variable, object, array –step -- Executes the next line and stops again –cont -- Continues running the program –!! -- repeats the previous debugger command. After debugging the program, recompile the program without the -g option.

jdb --A debugging example 1. Compile the program: javac -g StringOperations.java 2. Start the debugger: jdb StrigOperations 3. Set breakpoints: stop in StringOperations.main stop at StringOperations:15 4. Run program: run StringOperations 5. Extract debugging info with commands: list, locals, print, step, cont 6. Recompile the program: javac StringOperations.java

Free Java Tools JBuilder, Borland. VisualAge for Java, IBM. Forte for Java ( Sun Microsystems. JCreator, JEditor, etc. No native methods!! Keep this in mind: We have to be able to compile it and run it on the Java 2 SDK 1.3 platform

Vector Vector is a web-based application course administration E&CE 250 will use Vector for the following: –Tracking of your marks for Projects –Electronic submission of your Projects Every student in this course has an account in Vector. Use your Polaris userid to login, and your ID # as your initial password. Change your password immediately.

Submitting files with Vector Project 1-3 –individual submission, under studentID Project 4 –group submission, under groupID [even if group of one student]

Project 1-3: Naming of.jar files Name the file as your numeric Student id followed by pn where n is the project number. (That is, just p1.jar) In Vector, the file name will be prep ended by your Polaris account For example: If your Polaris userid is “student1” then this will upload the file as student1_ p1.jar

Project 4: Naming of.jar files Send to ece250 with group membership by signup due date (even if group of 1). You will get your GroupID by . Name the file as your GroupID followed by p4 where n is the project number. (If the GroupID is E250G007, use E250G007p4.jar) In Vector, the file name will be prepended by your GroupID For the above example, the file will be uploaded as E250G007_E250G007p4.jar

Please post common questions on the ECE 250 newsgroup You can also send us , phone us, or drop by during office hours Make sure you give yourself lots of time. Recomendations