I want to reveal my desktop java application to public, but I'm not sure how to protect it from reverse-engineering or source code stealing?
Is it possible to convert the application to an exe file? and if it is, wouldn't that be enough to protect it?
A Java executable and a native executable are both just a bunch of machine code (with optional annotations and stuff). So there's essentially no difference in terms of how easy it is to reverse-engineer.
If you are compiling with javac, you can use the
-g:none
flag to eliminate all debug info from being compiled into the executable.You can use a Java Obfuscator such as ProGuard.
If it's really worth someone's time to reverse engineer your source from the binary, they will. You might be able to make it slightly harder, but never impossible.