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.
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.
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.
I've used the Cavaj decompiler and it worked pretty well for me. You can just open up the jar file with any unzipping program like 7zip, .jar files are really just zip files. Then all you need to do is feed the .class files to Cavaj. The .class files are organized by package, so com.foo.Bar will be com/foo/Bar.class inside the .jar
Like Danny said, legality might be questionable depending on the situation. I've only ever used it to look at the source for an older version of an application I wrote but no longer had the source for.