I guess Java jar files can be reversed back to the source code and I want to prevent it from happening that easily. What I did was to convert the jar file into a Windows native exe file using launch4j.

Since the Java program has now been compiled into native machine language is it safe to say that it would be mostly impossible to reverse engineer the source code out of it?

  • 1
    That's not how Launch4j works. It doesn't compile the code into an exe - it just adds a native wrapper pointing to the JRE, and embeds the jar file into the exe: reverseengineering.stackexchange.com/questions/3532/…
    – Matthew
    Commented Apr 5, 2018 at 11:24
  • Okay...is there any way to protect my application then?
    – Swapnil B
    Commented Apr 5, 2018 at 11:45
  • 2
    Think about the most popular java application i know a normal Person knows: Minecraft. It don't have any feature which can 100% ensure that a qualified Person reverse engineer and exclude all the checks to ensure that you bought the game. The only thing what you then can't do is to play online (because the server check then some values given from the client which are then non-existing)
    – Serverfrog
    Commented Apr 5, 2018 at 11:59

1 Answer 1


You should research code obfuscation, because that's what you want.

Obfuscating the code will never prevent it completely and let me tell you that it's impossible to stop a programm from being reverse-engineered. But obfuscating the code will stop most script kiddies and make it at least harder to reverse-engineer your application.

There are a lot of those obfuscators out there and it will become opinion based to tell you which one is best or better.

So here is what you should do:

  1. Research code obfuscation
  2. Implement it in your application

Here is an SO link which could help you to get a start of it.

Not the answer you're looking for? Browse other questions tagged .