To install the java comiler and runtime on Windows XP, you must download the java SDK. This can be downloaded from the following URL.
http://java.sun.com/j2se/1.4/download.html
You must get the SDK(developer kit). The JRE (runtime environment) is used only to run java apps. JRE does not include the function to compile.
Documentation on all the classes and the
API can be found here:
http://java.sun.com/j2se/1.4/docs/
After you install the SDK, you have to add the following to your path environment
variable.
";C:\j2sdk1.4.0_01\bin"
In windows XP, this can be added under System Properties
1. Right click my computer and click “properties”.
2. Click the advanced tab.
3. Click environment variables.
4. Under system variables, select the path variable and click edit.
5. Now append c:\j2sdk1.4.0_01\bin to the variable value
and click ok.
Notice how this has been done below. It is underlined in red.
What about Windows 98
In Windows 98, the path variable is specified in the autoexec.bat. You will need to edit the "SET PATH" statement and append "c:\j2sdk1.4.0_01\bin" to it.
It might look something like this.
SET PATH=C:\WINDOWS\COMMAND;c:\jdk1.3.1
Your first Java Assignment
The simplest example is probably the classic one, Hello World. Note that in Java, a program is called a class, and functions or routines are called methods.
/*
* this is a remark
*/
class HelloWorld {
public static void main (String args[ ]) {
System.out.println ("Hello World");
}//this is the end of the 'main' method
}//this is the end of the class
Hopefully this will get you on your way to programming Java.