Help needed to run simple java program in linux

Hi guys ,
This is the first time i m running java application inside linux.

i have installed jdk-6u20-linux-i586-rpm.bin jre-6u20-linux-i586-rpm.bin in my linux machine.

and set JAVA_HOME and JRE_HOME variables respectively.

# echo $JAVA_HOME
/usr/java/jdk1.6.0_20/
# echo $JRE_HOME
/usr/java/jre1.6.0_20/

I have created a little java program helloworld.java

class helloworld{
public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
 }
}

I m able to compile the program by doing javac helloworld.java
but not able to run the program by doing java helloworld.
It is giving me following error.

Exception in thread "main" java.lang.NoClassDefFoundError: helloworld
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
Caused by: java.lang.ClassNotFoundException: helloworld not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/java/jdk1.6.0_20/bin/], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)

whenever i type java in command prompt it give me following output. M i missing anything.

# java
Usage: gij [OPTION] ... CLASS [ARGS] ...
          to invoke CLASS.main, or
       gij -jar [OPTION] ... JARFILE [ARGS] ...
          to execute a jar file
Try `gij --help' for more information.

I think /usr/bin/java is not poited to /usr/java/jdk1.6.0_20/bin/java
It is pointed to some other java (which i m not sure).

How do i change this pointing?
If i do the changes will it have any serious impact ?

check out this link

Thanks for the reply but in my case it is pointing to different java version.
whenever i do java -version it shows 1.4 .

But i have installed the latest one.

It should have shown something like 1.6.

check out my classpath and path variable values

kamaraj@kamaraj-laptop:~/Desktop/testing$ echo  $PATH
/home/kamaraj/Desktop/jdk1.6.0_10/bin:.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/real/RealPlayer
kamaraj@kamaraj-laptop:~/Desktop/testing$ echo  $CLASSPATH
/home/kamaraj/Desktop/jdk1.6.0_10/lib:.
kamaraj@kamaraj-laptop:~/Desktop/testing$ echo $JAVA_HOME
/home/kamaraj/Desktop/jdk1.6.0_10
kamaraj@kamaraj-laptop:~/Desktop/testing$ java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
kamaraj@kamaraj-laptop:~/Desktop/testing$ 

What should i do now?

just follow this website

PATH and CLASSPATH (The Java� Tutorials > Essential Classes > The Platform Environment)

or

LinuxLab - How do I set my java path and classpath?

Now its working.
Here is what i have done(Correct me if it is wrong)

i have fired "which java" command.

from the output i have got the location of java file
i changed the java file location from /usr/bin
to /usr/bin/javabackup (created new folder named javabackup).
added /usr/java/jdk<versionname>/bin to path using.
export PATH=$PATH:/usr/java/jdk1.6.0_20/bin/

Now its working file.