How can I open a .class file in Windows 7? I am getting a message saying that I can't see the file and that I have to choose a program to open it or look online for one. Is there any website, explanation, or download that will allow me to access ANY .class file I have extracted or have saved in my Documents?
-
Do you mean how do you run a .class file? Or how you can open the file in a human readable way? – Memento Mori Mar 06 '13 at 00:13
3 Answers
Are you trying to decompile the .class file and view the source code? You can use Java Decompiler. It has a standalone GUI and also plugin for Eclipse/IntelliJ.

- 6,470
- 3
- 26
- 37
Is there any website, explanation, or download that will allow me to access ANY .class file I have extracted or have saved in my Documents?
It depends what you mean by "access" or "open". It also depends what you mean by extracting ... and what you extracted them from.
If you are trying to run the class files, then the standard way to run a Java application is to use the
java
command, as documented on the Oracle website. For example: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html. But how you use it depends on the nature of the thing that you downloaded and / or extracted. (Some ".class" files are not applications. Some ".class" files are designed to be run without extracting them from their JAR file container.)If you are trying to look at the code in the class files, you could use the
javap
command to disassemble it. Or you could use a third-party tool to decompile it. But unless you have a clue as to what you are doing, this is not likely to help much. And since I can't really guess what you are trying to achieve, I can't offer you any useful references.If you are trying to do something else, you'll need to explain what it is.
Either way, you need a Java installation on your machine before you can do anything.

- 698,415
- 94
- 811
- 1,216