| Author |
how to open a .class file ? can not open with text editors!
|
sahar sa
Ranch Hand
Joined: Jul 06, 2009
Posts: 102
|
|
Dear friends,
I have some".class" files but I cannot open them with text editors like notepad and word and not even by netbeans. How can I open it?
the file contains some java classes.
thanks,
Sahar.
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16680
|
|
Class files are binary files. They are not text files, and hence, can't be opened by a text editor.
To view the file, you'll need some sort of editor just for binary files. Or maybe even a decompiler.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
sahar sa
Ranch Hand
Joined: Jul 06, 2009
Posts: 102
|
|
Dear,
Thanks for your complete answer. now I can open the file using Dj Java Decompiler.
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8430
|
|
Well I could "open" mine in notepad. It's a different story that it makes no sense, because, like Henry said, it is a binary file.
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9939
|
|
I would ask you, why do you WANT to open a .class file? Would you open a .exe file?
There are ways to open/look at one, but that's probably not what you REALLY want to do. Is it?
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19214
|
|
fred rosenberger wrote:Would you open a .exe file?
Yes. Even if I wouldn't use a resource investigating tool to retrieve bitmaps, icons etc from the exe, I would still open it with rundll32.exe. You might call that "run" the .exe file
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32595
|
|
|
Try the javap tool.
|
 |
 |
|
|
subject: how to open a .class file ? can not open with text editors!
|
|
|