You have to add the directory containing the java commands to your PATH. To do this, you have to do the following...
From the command line:
This will only change the path for your current session. You can however, add these two commands to your startup script and it will work every time you log in.
If I remember correctly, the java commands are in the /j2sdk1.4.2/bin directory, but don't quote me on that. Also, check out this site for more info on the path:
Hope this helps...