Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: How Do I decompile jar and load it as a project?

Tags:

eclipse

jar

how can I decompile a jar and load it as a project in my Eclipse so I can modify the code ?

fyi I have googled jar decompiler. Looking for a guide or any insight on experiences with it.

like image 530
KJW Avatar asked Aug 10 '10 19:08

KJW


1 Answers

Unless you also have the source code (either in the JAR, or separately), then the best you can do is to use a Java decompiler. Depending on how the code was compiled in the first place, this might generate source code which is significantly different to what the original author wrote (although functionally identical, of course). For example, certain optimizer options could result in loops being re-written and local variables being removed. Certain debug options could result in the names of local variables being removed, so the decompiler will have to invent (meaningless) names for them, etc.

I would also question whether what you want to do is legal. Generally, if a project is licensed for modification then its source code will be available and you won't need to do what you're proposing.

like image 98
dty Avatar answered Nov 06 '22 15:11

dty