File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "conversion " Watch "conversion " New topic



Joined: Apr 29, 2000
Posts: 14
Is it possible to convert .class file to .java file.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Interesting qstn.....this seems more like a
reverse engg than just a simple conversion...
not sure if we can do this kind of stuff.
If I were to guess, I would say NO.
- satya
Surya B
Ranch Hand

Joined: May 10, 2000
Posts: 98
Hi Bharati,
I don't know whether this question should be in the programmer certification or not , anyway coming to your question,you can convert a .class file to a .java file using decompilers and the most commonly used is the decompiler mocha.
But i guess if you want to decompile a commercial java application then it may not work because they use something called obfuscators whereby the source code produced by a decompiler is much less readable.By the way Mocha is a shareware and you can dowload and use it.Hope this helps.
Deepa sivasankar
Ranch Hand

Joined: Jul 22, 2003
Posts: 35
You can use the java disassembler and see the assembly instructions. But i am not sure for getting the source.
Anand Iyer

Joined: Jun 13, 2000
Posts: 26
Yes.. u can convert the .class to .java files. There are freewares available.
Also, to counter this one, there are special softwares (I think these are called Obfuscators).. which kind of "encrypt" your
.class file so that the decompilers don't give good results.
If you want to have a look at the .class file format you can see
one at After that maybe you will write one
p.s. Vijay Mukhi's site also has a link to a Decompiler.. Check it out..

[This message has been edited by Anand Iyer (edited June 14, 2000).]
I agree. Here's the link:
subject: conversion
It's not a secret anymore!