Attention Java guru's!

Community Forums/General Help/Attention Java guru's!

Jaydubeww(Posted 2010) [#1]
So, I have a .jar executable file and I don't have the source code. As far as I know I can rename it with .zip, extract it, and modify the source. But, how do I make it a.jar executable with the modifications? Is it possible without the original source (Isn't all the source in the .jar executable?)

Thanks for your help!


Warner(Posted 2010) [#2]
I do know a little Java, but I have no idea. But maybe it is better to ask this question on the Java forums here: http://forums.oracle.com/forums/category.jspa?categoryID=299
I posted there when I had Java issues, and the community there was really helpful.


marksibly(Posted 2010) [#3]
Hi,

I think a jar only contains the compiler generated binary '.class' files - ie: you probably can't reconstruct the source '.java's from a jar.


SLotman(Posted 2010) [#4]
There are some Java "decompilers" around. At least on older Java versions it used to work - don't know how it is nowadays.


therevills(Posted 2010) [#5]
Yeah, you can use a decompiler to generate the source from a class file.

If the coder does not want you to read the source they can run their source thru an obfuscator, which will make it very hard to read the code.

I normally use WinRar to open Jars (you dont need to rename it to .zip) and with WinRar I know you can alter and add files okay (it keeps the folder structure (unlike WinZip)), I havent actually tried altering a class file though...

PS Also a Jar can include the .java files not just the .class files, its up to the coder what to include... normally its just the class files though.

Last edited 2010

Last edited 2010


Jaydubeww(Posted 2010) [#6]
Thanks guys. I posted on another java forum and yes, it looks like I'll need a decompiler because the only files the jar has are class and xml files.

BTW, what I'm trying to do is translate CollIDE (for blitzmax) into english considering it was released under GPL.

I'll post back here if I can get it working...but as of late I haven't had much programming time with college and work.

Last edited 2010