Why its so easy to decompile .jar files?

The question is above i mean it makes no sense to post non-open-source projects ?!

Because “jar” files are just a collection of bytecode that has to be read by the JVM. If the JVM can read it, programs like jd-gui can do this to.

But it does make sense to make a non-open-source project. Lets say you provide a closed source jar. Other people can’t take the jar and share the source. Even if they would modify it, it still would fall under the closed source licence.

That’s why all “sources” that change the minecraft jar. Work with .patch files or decompile the jar on the users/developer’s pc.


You can also obfuscate it to protect the source.

You can decompile any binary file, even C code.

But without proper class, variable and method names, it will be very hard to understand anything.


The problem with decompiled code is that you get a source that behaves like the original source but it’s not an exact copy. You can modify and compile it again, but it will never be exactly like the original source. :wink:

And yes, reverse engineering is always possible. It’s just a matter of work you put into it. If you wanted to, you could decompile OSX or Windows too. It would take you years to figure proper classnames and methods out, though.

MCP, Forge, Cauldron, hMod, Bukkit, Sponge, Canary, etc are all examples of this. :smiley:

1 Like

While it is true you can decompile C code. It’s a completely different beast. Because it isn’t just translated into bytecode, and you can do some crazy things. The difference is with C code, you can get a pretty good idea what it’s doing, but usually you can’t know for absolute sure. For example reversing java code you can know for sure it’s a class. However in C++ classes, and structs share the same structure (if you know what your doing it’s pretty easy to assume it’s a class) so although you can be 90% sure it’s a class there technically is no guarantee.

A few people are too lazy to run a few git commands at times.

1 Like

I am pretty sure non opensource projects also use version control.

Almost all OSS use some type of version control. You’re more likely to find the lack of any VCS with close-source projects.