|
|
The
Java Class
Getting
Started
|
|
|
|
|
|
|
First sign-up
on the mailing list!
Send an empty e-mail to javaclass-subscribe@mlm.awoolf.com
(no subject or content needed). In a few minutes you will receive a reply
requesting that you simply reply to the longest e-mail address I have
ever seen. Clicking on the reply button should do it. You will soon receive
a confirmation that you are on the list. To send to the list send mail
to javaclass@mlm.awoolf.com
|
|
|
|
|
|
|
You say you are not
using Windows
Many of the details in the following instructions assume that development
is being done on a Windows platform. Please help us all by providing recommendations
and experience with tools and process for other platforms via the mailing
list.
|
|
|
|
|
|
These Instructions
will Age and go out of Date
Please help me keep them
up to date. When you notice a change or a missing link please send me
an e-mail and I will change update this page to keep it consistent with
the sources.
|
|
|
|
|
|
Get and Install
TextPad (or other editor)
- Go To http:
//www.textpad.com/
(opens in a separate
window)
- Download The Free Evaluation
Copy
The last time I checked TextPad cost $27. The evaluation copy just asked
if you wanted to buy every hour or so of use. Pay the $27 and it will
stop asking. I don't know if it ever stops and demands payment because
I bought it after a couple of days.
- Install It
- Configure TextPad
TextPad is a general text editor but you would like it to assume that
you are typing Java even if you are entering a new file so it can help
you with the syntax.
- On the Configure menu
select "Preferences"
- In the Preferences dialog
select "File"
- Set the default file
extension to "java"
- Start Typing
Enter the HelloWorld Java program
- Save the Program
Build the directories and save the program in the C:\tij\my\C02
directory with the file name HelloDate.java.(We will compile it later.)
|
|
|
|
|
|
|
|
Get Bruce Eckel's
Book and Code Examples
You probably want the soft copy of the book even if you buy it (I find
both useful in different ways.) and you will want the code examples in
either case.
- Go to
http://www.bruceeckel.com/
(opens in a separate
window)
- Under the title "Book
and Book Support" find and follow the Book Download Links
- Pick One
You are looking for 6 zip files for Thinking in Java, 2nd Edition (only
about 1.5MB total)
- Download all 6
- Expand the 2 code files
into C:\tij
- Expand the 4 book(html)
files into C:\tij\book
- Checkout the Book
- With your web browser
open the file
C:\tij\book\SimpleContents.html
- Bookmark the file
- Browse Chapter 2 Everything
is an Object
- Find the class HelloDate.java
in Chapter 2.
- Find the example code
in C:\tij\C02
|
|
|
|
|
|
|
Get and Setup Java
2 SDK (JDK)
- You work for a company
that participates in the development of Java (Sun, IBM, ...)
- See your instructor for
special instructions. If not in a class look for an internal support
site. You will have additional resources available and guidance on
using Java in product development.
- Everybody Else
- Go to: http://java.sun.com/j2se/1.3/download-windows.html
(opens in a
separate window)
- Download Java 2 SDK, v
1.3 Software for Windows 95 / 98 / 2000 / NT 4.0 (about 30MB to download)
- Run the install program
- Let it install into C:\jdk1.3
|
|
|
|
|
|
|
|
Set PATH and CLASSPATH
- Add to PATH string
C:\jdk1.3\bin; ... (assuming
you used the above install directories)
This lets Windose find java.exe when you type java in a command window
- Set CLASSPATH string to
.;C:\jdk1.3\bin;C:\tij
(assuming you used the above install directories)
- "."
lets Java find your program in the current directory
- "C:\jdk1.3.0\bin"
lets Java find the Java libraries
- "C:\tij"
lets Java find Libraries provided with Thinking In Java
|
|
|
|
|
|
|
|
Compile and Run HelloDate
- From the Windose Start Menu>Programs
open a Command Prompt
- Make the current directory
C:\tij/my/C02
Can be done with command: cd
C:\tij/my/C02
- Compile the program in HelloDate.java
Can be done with command: javac
HelloDate.java
The compiled program will be in HelloDate.class
- Run HelloDate.class
Can be done with command:
java HelloDate
When done close the Command window it will not be needed for a while.
|
|
|
|
|
|
|
|
Compile and Run HelloDate
Again
- Open HelloDate.java
in TextPad
- Compile the program HelloDate.java
Do it with Compile Java on the Tools menu (or Ctrl+1)
The compiled program will be in HelloDate.class
- Run HelloDate.class
Do it with Run Java Application on the Tools menu (or Ctrl+2)
When done Close the Command window and TextPad it will not be needed
for a while.
|
|
|
|
|
|
|
|
Get Sun Documentation
- Go to
http://java.sun.com/j2se/1.3/docs.html
(opens in a separate
window)
- Download JavaTM 2 SDK Docs
- HTML Format (about 23MB)
- Unzip it to C:
We want to put it in C:\jdk1.3\docs.
The internal paths in the zip file should add the \jdk1.3\docs
|
|
|
|
|
|
|
Explore the Sun Documentation
- Start your browser and open
the filefile://C:/jdk1.3/docs/index.html
(opens in a separate
window) If it fails
to open make sure you put it there.
- Bookmark the page you will
use it often
- Click on the API & Language
link
- Click on the Java 2 Platform
API Specification link
- Use Index to find "Date
- class java.util.Date"
- Click on the link Date and
read a bit about Date
- In the upper left browser
frame there is a list of Packages. Find java.lang and click on it.
- Now the lower left frame
in the browser will have a list of Interfaces, Classes, Exceptions
and Errors in the java.lang Package.
- In the lower left frame
find the Class "String" and click on it.
- Now the large frame on
the right will provide details about the String Class. Spend some
time reading the details but don't expect to understand much.
- In the upper left browser
frame near the top click on All Classes.
- Now the lower left frame
in the browser will have a list of all the Classes and Interfaces
that are included with Java. You will be able to build additional
classes and use those provided to build your Java Systems.
- In the lower left frame
scroll down the list and take a guess at how many classes (and interfaces)
are provided.
- If you see a class name
you can't resist click on it and see the description to the right.
|
|
|
|
|
|
|
Congratulations!
You are Up and Running
Send an e-mail to the list
at javaclass@mlm.awoolf.com
to let us know that you got here. Now go help a classmate that is stuck.
|
|
|
|
|