you must first check if your java program is a program for java or an applet for HTML..
compile the program using javac..you need first to locate the executable program javac or Java compiler..
for example, it is located in C:/>J2sdk1.4.0/bin then type in your command prompt:
C:\>cd\
C:\>cd j2sdk1.4.0\bin
C:\j2sdk1.4.0\bin>javac clsProgram.java
providing that your program was saved in .java format, NOT .txt or text.
after compiling it, type the ff:
C:\j2sdk1.4.0\bin>java clsProgram
NOTE that you do not need to include the .java file extension because after it has been compiled, it is already a class file..
..If it still is not working, try appletviewer instead of java.......
goodluck..