CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

7
CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014

Transcript of CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

Page 1: CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

CSC 243 - Java Programming, Spring, 2014

Welcome to Java Programming.Tuesday, January 21, 2014

Page 2: CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

What are we planning to do?• We will transport ourselves from C++ to Java

programming in a series of graceful steps.• We will use modular construction techniques,

with the assistance of Java classes and interfaces.• We will learn how to get leverage from the

massive Java class library.• We will learn to use programming tools such as

Eclipse.• We will enter the realm of graphical user

interface (GUI) and other event-driven programming.

Page 3: CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

References• http://wps.pearsoned.com/wps/media/access/Pearson_Default/14132/1

4471955/login.html

has downloads from our textbook. • GNU make http://www.gnu.org/software/make/manual/ • http://java.sun.com/javase/downloads/index.jsp docs.• http://java.sun.com/javase/6/docs/ has on-line docs.• http://java.sun.com/javase/6/docs/api/index.html class lib.• /export/home/faculty/parson/JavaLang on bill.kutztown.edu• Make sure that /usr/jdk/jdk1.6.0_02/bin is near the front of UNIX PATH.

• Follow instructions in the JavaShellSetup2011.pdf document (accessible via my home page at http://faculty.kutztown.edu/parson) to set up and verify your Java compilation environment. Setup verification is due by Feb. 7.

Page 4: CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

Java programs run on a Java Virtual Machine (JVM)

Java source program, FILE.java

javac –g FILE.java (creates FILE.class)

java PACKAGE.FILEwhere PACKAGE is a subdirectory under ~/JavaLang

This runs PACKAGE.FILE on an interpreted JVM.

Page 5: CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

Categories of Java Virtual Machines

• Java EE (Enterprise Edition) comes with enterprise level class libraries, for example, large database and server infrastructure

• Java SE (Standard Edition) is the typical configuration for non-corporate users, including single users

• Java ME (Micro Edition) is for embedded devices. It has a small and special-purpose class library.

Page 6: CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

Varieties of Java “programs”

• Stand-alone applications run like C++ programs.

• Applets run inside a web browser (GUI).• Servlets run inside a web server (HTML).• Java Frameworks can select and load Java

plugins (components) at run time.• Java can run on small footprint embedded

devices (for example, cell phones).

Page 7: CSC 243 - Java Programming, Spring, 2014 Welcome to Java Programming. Tuesday, January 21, 2014.

First example Java program

• CountArgString counts distinct, non-overlapping occurrences of a string in a file

• JavaLang/countargs

• Make sure you walk through my UNIX environment setup instructions and email me a screen trace by January 25.

• Make sure CLASSPATH include your $HOME/JavaLang• makefile drives execution of compile and test steps

• gmake build to compile Java files• gmake clean test to run test cases• gmake clean to clean up test output and compiled files