Friday, May 16, 2008

Hello World Java Program Issues Resolved

The first thing I encountered was that the installer installed the Java Development Kit (JDK) in the program files of my computer’s c: drive. Making the source file is the usual cut & paste but I saved it into the Java folder in the c: drive program files. Otherwise I can’t see it in the CMD (command prompt) when I type dir. Another problem was to compile the source file. The Hello World tutorial for Windows (http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html) assumes that one has installed the JDK perfectly.

Mine was not perfect so I had to try to find a solution in the installation notes for JDK Windows on the Java.Sun.com website. So I did the below & restarted the computer then continued with the Hello World tutorial where I left it. The computer chugged the data for a few splendid seconds; it was a happy sound for me, the source file successfully compiled! Note that I installed the jdk1.6.0_10 so its how one should add the PATH value in the User Variables; according to the JDK version.


How do I set the PATH permanently?

To set the PATH permanently, add the full path of the jdk1.6.0_\bin directory to the PATH variable. Typically this full path looks something like C:\Program Files\Java\jdk1.6.0_\bin.

Set the PATH as follows on Microsoft Windows:

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

b. Click Advanced > Environment Variables.

c. Add the location of bin folder of JDK installation for PATH in User Variables and System Variables. A typical value for PATH is:
C:\Program Files\Java\jdk1.6.0_\bin


For more information on the above JDK installation guide, please visit the particular Java.Sun.com web page (http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.html). Well, so much for following the Hello World tutorial instructions, at least for the above mentioned particular parts. Without some basic ingenuity of knowing how files are organized / arranged in the OS & drive; & persistence for trying to find a solution at the correct place, I would have not made it through my first Java tutorial.

No comments:

My latest images for sale at Shutterstock:

My most popular images for sale at Shutterstock: