title: Does compiling Java to native code protect the source code?
body: <p>Now, I know that...</p>
  
  <blockquote>
    <p>Anything can be reverse engineered, given enough time and resources.</p>
  </blockquote>
  
  <p>However, would compiling your Java code to native code with a tool like <a href="http://gcc.gnu.org/java/" rel="nofollow">GCJ</a> make it more difficult to decompile? I mean, given a few minutes, I can decompile a .jar using <a href="http://java.decompiler.free.fr/?q=jdgui" rel="nofollow">JD-GUI</a>, and it is relatively accurate. Most of the "Java to EXE" converters are just .exe launchers for the JVM, and while there are many benefits to the JVM, I have been led to believe that security of the source code is not one of them.</p>
  
  <p>Bottom line: Can you use something like GCJ to compile your Java source (or .class) files to native machine code, and if so, will that protect it from decompiling?</p>
  
  <p><strong>EDIT</strong>: Ideally, it would be something more than just obfuscation. The specific project is a commercial game, so what we are looking for is a way to make it more difficult to get to the source code to begin with, not just understand it. Also, I'm not sure that Steam accepts .jars, and we are planning on submitting it to the new <a href="http://steamcommunity.com/workshop/about/?appid=765&amp;section=faq" rel="nofollow">Green Light</a> project.</p>