Java is an interpreted language. Usualy Java is found on the Web, in small programs called applets. But many
Java applications exist. They are like applets, but require a Java Virtual Machine to run on your system.
Netscape Communicator and any Java-enabled browser can run Java applets, but what if you want to run Java
programs?Java programs are files ending with .class and must be run in a JVM.
The Java Development Kit comes witha JVM. What you need is the Linux port of the JDK that you can find at
http://www.blackdown.org. Once installed, you can run any Java application using the line:
java Program Where java is the JVM, from the JDK package, and Program is the class found inside the Program.class file.
Note that you do not have to specify the .class part of the file to run it.
"Windows Linux Tips: Running Java programs"
Reference : techpraveen.com