• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to open a .class file ? can not open with text editors!

 
sahar sa
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21490
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
sahar sa
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear,
Thanks for your complete answer. now I can open the file using Dj Java Decompiler.
 
Maneesh Godbole
Saloon Keeper
Posts: 11165
14
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12196
35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Rob Spoor
Sheriff
Pie
Posts: 20659
64
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Campbell Ritchie
Sheriff
Pie
Posts: 50171
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the javap tool.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic