[Menu]>[Java Programming]


Preparation of Java programming


On these pages, I will explain the programming method that JDK( Java Development Kit ) is used.
Even, it is showing the example in JDK version 1.0.

Acquisition of the programming tool

Installation of the tool

Copy method of the sauce program listing

Operation of the Java compiler


About Java programming language, see the specialty book.



Acquisition of the programming tool


The following is the site of SUN which developed Java.
http://www.javasoft.com/products/
Because JDK1.0.2 is quite old, it may not appear in a site.
If you click the following links, you can download the copy of JDK1.0.2.
JDK-1_0_2-win32-x86(1).zip ( 2,779KB )



Installation of the tool

A little of the knowledge of the DOS command becomes necessary to handle JDK1.0.
It becomes the operation that used the window of the MS-DOS prompt in the case of Windows.
There might be bewilderment in the person who is operating only with the Windows screen (GUI).

When JDK is installed rewriting of the Autoexec.bat file necessary.
The drive designated change using the DOS command is necessary.
(As occasion demands)
The change of the directory using the DOS command is necessary.
( CD command )


When it writes concretely it is as follows. ( In my case )
The person who the following contents are not able to comprehend shall receive the support to the person who has a good knowledge of the computer a little.
The following explanation is the operation that used Windows95.

1. Installation of downloaded JDK
Case of JDK1.0.2, JDK-1_0_2-win32-x86(1).exe (3,752KB) can download.
This is transferred to the route directory( There are several folders in the subordinate of the D drive, it is not able to be to the folder and D drive itself ) of the drive( D in the case of me ) with Explorer etc.
Double-click the JDK-1_0_2-win32-x86(1).exe file that moved to the route directory of the D drive with Explorer.
The folder called Java is made newly to the D drive by this operation and all the files of JDK are installed in the inside.
If the installation finishes JDK-1_0_2-win32-x86 (1) .exe is unnecessary.
It backups to the outside file.( MO etc. )

2. Change of the Autoexec.bat file contents

The place of the program needs to be registered to operate JDK with the DOS prompt.
The certain Autoexec.bat file is opened in the route directory of the drive at the time of computer triggering( C drive in the case of me ) with the text editor such as a notepad program.
This file is very important file. There is the possibility that the computer stops acting when rewrite and mistake. Carry out the rewriting prudently.
Backup the Autoexec.bat file before the change due to safety.
";drive:\JAVA\BIN" is added to the item of PATH as follows. ( Do not forget what punctuates with a semicolon )
It is doing as follows in the case of me.
PATH C:\ --Various contents are written-- D:\WIN95;D:\WIN95\COMMAND;C:\DOS;D:\JAVA\BIN
The red part is an addition part. Do not change other parts.
Save the file with the same name.
Restart the computer.( To do the contents of Autoexec.bat file effectively )



Copy method of the source program list

There is the link to the source program list in the page where is introducing each applet.
The source program list is able to utilize and is able to copy to the editor such as notepad.
You can copy with the following method.

All the letters of the source program list are reversed the color from the letter of the top while pushing the left button of the mouse.
Designating the copy from the editing menu of the browser, the program list is copied to the clip board.
Open the window of editor such as notepad.
Designating the paste from the editing menu of the editor, the source cord of the program list is pasted to the editor.
Save the file as named.
The name designates the class name with extension( java ) of the applet. ( Example: Scroller.java )
The class name is being designated in the source cord. Without fail the same name is designated.
The capital and the minuscule are supposed to be different.
The name is changed if the source cord is changed later.
"java" of the extension is indispensable.( It is not changed )


The green part of the source cord( Being easy to understand the color was attached )
is a comment part and be disregarded in the compiler.
There is no problem even if list that copied is compiled as it is.



Operation of the Java compiler

It is the operation that transforms the source cord file( xxx.java ) that was written with the text to the file of the implementation form( xxx.class ).
It is good to decide the folder that inserts the source cord file before carrying out this operation.
I am setting up the Work folder to the subordinate of the Java folder newly.
If there is not the source cord file in the Work folder it can not the operation from this.
The source cord of the applet can also be taken in with the method that showed with "Copy method of the source program list".
The MS-DOS prompt is triggered.
When it triggers the window of the black background opens.
I think that the following contents are written in the inside.

Microsoft(R) Windows 95
(C)Copyright Microsoft Corp 1981-1995.
D:\Win95>

The display contents might differ a little by PC.
Win95 is in the case of my PC and I think that the ordinariness is Windows.
The cursor should be flickering in the back of >.
It inputs with EXIT when you finish the MS-DOS window.
( Or forcibly it finishes by click certain X in the corner on the right of window )
The implementation directory is moved to the directory that has source file.

D:\Win95>cd d:\java\work[Enter]
D:\Java\Work>

The part of the red letter is an input part.
The space code is inserted in the back of "cd".
"cd" is the omission of a Change Directory.
You implement compiling.
( In the case of Scroller. java )

D:\Java\Work>javac Scroller.java[Enter]

"javac" is the command of compiler triggering.
The space code is inserted in the back of "javac", same as "cd".
The capital letter and small letter are distinguished in Java.
Also, as for the top of the file name, seem to there are many capital letter.
The next command waiting prompt( D:\Java\Work> ) is displayed that compiling finishes without error.

It should could the file of "Scroller.class" to the Work folder with the aforementioned operation.
This is the implementation form file of a Java applet.
Inputting with EXIT the DOS window is closed.