Okay, a .class file contains the compiled (byte code) version of a .java file. You don't want to open a .class file unless you are trying to decompile it into a .java file (google search "java decompiler").
Perhaps you are trying to run a java program. In that case "java filename" will do it without the .class extension. If it is in a package then "java my.package.name.filename" will do it. You may have to add the class path for the file, "java -cp . filename" adds the current directory to the classpath or "java -cp . my.package.name.filename"
You can open any .java file with any text editor. To compile it you will need the SDK which can be found at http://java.sun.com/j2se/1.4/download.html
to execute a .class file (assuming it has a main() method) you will need the jre which can be found at http://java.sun.com/j2se/1.4.1/
or the sdk mentioned above.