Showing posts with label java setup. Show all posts
Showing posts with label java setup. Show all posts

Sunday, January 20, 2008

Java Installation Setup

Hi all, just a quick,

Here I put some guide for Java path environment variable setup and test your java code.

After installing Java Development kit (guna kak fuzi nye version 1.6.0_04),

1. Click Start > Control Panel > System on Windows XP or Start > Settings > Control Panel > System

2. Click Advanced > Environment Variables.

3. Add the location of bin folder of JDK installation for PATH in User Variables and System Variables. <-- tukar kan dua dua

A typical value for PATH is:
C:\Program Files\Java\jdk1.6.0_04\bin


ok..done, then try to test your java code, Hello world program:

1. Open notepad, paste:

/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}

2.Save the file under  C:\Program Files\Java\jdk1.6.0_04\bin, save as HelloWorldApp.java

3. Open cmd @ command prompt, get into directory "C:\Program Files\Java\jdk1.6.0_04\bin", then compile the java file such:


C:\Program Files\Java\jdk1.6.0_04\bin>javac HelloWorldApp.java

4. If compilation process is okay, no error should be appeared, then run the java program.


C:\Program Files\Java\jdk1.6.0_04\bin>java HelloWorldApp
HelloWorldApp!





All the best!....tioman~ heh

Signing off,