Internet Systems Design:
Technologies for Modern Information Systems

Using Java

Note that more detailed instructions are available at:

http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html

Writing Java Code

You can use just about any word processing software to write and edit Java code but do make sure that you save the file as text files (ASCII) -- but with .java at the end.

You could also use CodeWarrior or WinEdit .

How to Download and Install the JDK

You can download Java2 SDK 1.4 from http://java.sun.com/j2se/1.4/index.html. The file is called  j2sdk-1_4_0-win.exe and it is rather large ( Filesize around 37,000,000 bytes.)

In Windows Explorer,  double click the icon  and keep clicking the Next Buttons.

A lot of documentation is available at http://developer.java.sun.com/developer/infodocs/

In order to check the installation is correct or not, you can go to C drive (or wherever you have placed the file) and check if there is a folder or directory called j2sdk1.4.0. If it does not exist then you will have to go through the setup again.

How to Compile and Run (Execute) Your Java files

You will need to use the MS-DOS Prompt window for this.

The easiest way is to copy your Java file into the folder of j2sdk1.4.0\bin in your C drive. Then launch your MS-DOS Prompt, you should have a MS_DOS Window. It shows in the following

C:\Windows>

Change your directory location using DOS command "CD", as shown

C:\Windows>cd .. (return)
C:>CD j2sdk1.4.0\bin (return)
C:\j2sdk1.4.0\bin>

Now you can compile your Java code as 
C:\j2sdk1.4.0\bin>javac JavaFile.java (return)

After success of your compiling, your can run your Java Byte code, as

C:\j2sdk1.4.0\bin>java JavaFile (return)

If you want to compile and run your Java codes in different directory rather than in j2sdk1.4.0\bin directory, you do not need to copy or create your Java code in the bin directory, you can use one of the following methods.

Use notepad  or another word processing software to open your autoexec.bat file in C drive, and then append the following lines, before you save it.

set PATH=c:\j2sdk1.4.0\bin;%PATH%;   
set CLASSPATH=.;c:\j2sdk1.4.0\lib;%CLASSPATH%; 

Then, restart your computer. Now you can use javac or java in any directory.

Some further and more detailed information is available at

http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html