Appendix A: Installing Java SDK

You need JavaTM 2 SDK, Standard Edition (J2SE SDK), version 1.4.2 or higher. The JavaTM 2, Standard Edition Runtime Environment (JRE), version 1.4.2 can suffice if you only plan to run the demonstration applications. But we are not here to watch demos, letâ€™s develop our own apps.

I installed J2SE 5.0, which was installed by default in C:\Program Files\Java\jdk1.5.0_04 in Windows 2000. You can change the default location but remember where you install it.

Now change the system path variable so that you can use the java commands (â€˜javacâ€™ or â€˜javaâ€™) in the command prompt directly. I will show you how to do this in Windows 2000.

However while using the wireless toolkit for J2ME development, we wonâ€™t be using direct command-line interface. So in case it looks cumbersome, the following steps of setting PATH variable can be skipped.

Just install the java SDK at a suitable location and remember the location.

To change the system path variable (Windows) -

Right click on â€˜My Computerâ€™

Select â€˜Propertiesâ€™

In the properties window select â€˜advancedâ€™ tab

Click on â€˜Environment Variablesâ€™ button

Create â€˜PATHâ€™ variable if not already present by clicking new / If already present edit the â€˜PATHâ€™ variable

Add the path of â€˜C:\Program Files\Java\jdk1.5.0_04\binâ€™ (Remember to use the actual path you used for the recent java installation and in the PATH variable separate entries with a semi-colon)

Now open a command window (you can do it by typing â€˜cmdâ€™ in â€˜Runâ€™ of â€˜Start Menuâ€™) & type in the command â€˜java â€“versionâ€™ (note there is a space after java). The output should be something like â€œjava version "1.5.0_04"â€ (the version might be different in your case)
If you get a message saying â€˜unknown commandâ€™ or showing a wrong java version, recheck the PATH setting as described in the previous step

If the problem is not solved, donâ€™t worry. You can always use the complete path e.g. â€œC:\Program Files\Java\jdk1.5.0_04\bin\javaâ€ â€“version.

Use the menu at top-left corner for navigation.

Created on 01/21/2007 12:50 AM by admin
Updated on 02/16/2007 05:34 AM by admin