Memo to rodwf:
I had problems downloading the same program, so after I found a solution to all my problems, I made "an instruction sheet" and this might be of help if you encounter another problem.
Here it is:
Java Instructions-Classpath+Run-Sep.15.05
File \\586\E\Data\Java4+5\*.*
Charles Keller – For Win98 and Win-XP
----------------------------------------------------
1. Setting your PATH & Classpath:
To successfully set your PATH & SET CLASSPATH in your Autoexec.bat file, using Notepad
“Autoexec.bat” (using quotes), you have to enter them as follows:
SET PATH=%PATH%;C:\;C:\Windows\Command;C:\J2SDK1.5.2.09\bin;
(Your exact Java program name, like “J2SDK1.5.2_09” or “SDK1.5.0_04” must be included in your PATH, you also have to add “bin” to it).
SET CLASSPATH=C:\Java-CK (or wherever your *.java files resides)
Your folder name can be anything you wish, like C:\> Java-Program or C:\> J-Program
2. To activate your new settings in the Autoexec.bat file:
a) Go to C:>
b) at C:> Type “c:autoexec.bat”, without the quotes and <press Enter>
3. To create your Java Program:
Go to NetBeans IDE (free from SUN Developer Network)
or any other Java Programming Editors, like GEL IDE, Jcreator or Jedit:
and create your *.java program like this:
//: File: C:\Java-CK\HelloDate.java
import java.util.*;
/** Java example program.
* Displays a string and today's date.
*/
public class HelloDate {
/** Sole entry point to class & application
* @param args array of string arguments
* @return No return value
* @exception exceptions No exceptions thrown
*/
public static void main(String[] args) {
System.out.println("Hello, it's: ");
System.out.println(new Date());
}
} ///:~
Go to page 2
------------------------------------
Page 2
4. To create your *.CLASS file:
a. Go to a DOS-Win Box
b. at C:> type “CD Java-CK”, without the quotes, press <Enter>
c. at C:\Java-CK> type “javac HelloDate.java”, without the quotes, <press Enter>
and your HelloDate.class will be created under C:\Java-CK\*.*
The JAVAC compiler will create your *.class file and put it in the same folder
where your HelloDate.java resides.
JAVAC stands for compiler and the computer converts the text in “HelloDate.java” into a machine language that the computer can understand, which are only Ø and 1, like 1Ø1Ø11Ø11Ø.
If the binary notation in the machine language is: 1Ø1Ø1111ØØ it means decimal number: 700
5. To RUN your HelloDate program:
d. Go to a DOS-Win Box
e. at C:\> type “CD Java-CK”. without the quotes, press <Enter>
f. at C:\Java-CK> type “java HelloDate”, without the quotes, press <Enter>
g. and your java program will run like this:
h. Hello, it’s:
Thu Sep 15,21:25:41 PDT 2005.
5. Capitalization in Java:
The Java language is very much “case sensitive”.
If your class is “HelloDate” and you type “java hellodate”, it will not work.
------ End.