This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes from class to java file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "from class to java file" Watch "from class to java file" New topic

from class to java file

AssafM Mizrachi

Joined: Jan 24, 2011
Posts: 1
Hi ,

i am loading classes from API jars, and according to these classes ( reflection ) i am using javassist to create new classes files,
write them to the file system using writeFile() method , the thing is i need .java files in order to manually edit these new classes.

does any body know if i can make java file from class file , mabye javassist can also write java file?

any way i have tried Decompiler and it's not working ( out of bound exception), all i need is java files after all , any idea's???

\thank you
Greg Charles

Joined: Oct 01, 2001
Posts: 2841

What decompiler are you using? It does sound like decompilation is your goal, not run-time byte code manipulation, which is the main function of Javassist. The decompiler I've used in the past is jad, which is still free as far as I know. There also a "jadclipse" plugin to Eclipse.
subject: from class to java file
Similar Threads
Is possible to write Class object to .class file?
Java Code Parser
How to create RPM package for my java application in FC10 linux
What can javassist do with the beans created by spring already?
Dynamically create a class at runtime