I distribute a jar file that contains all my classes. Is there a way to protect the classes in the jar to be de-compiled? Can I sign or seal the jar file so that it cannot be read by a decompiler? Thanks. [ February 04, 2005: Message edited by: Bruce Jin ]
BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design
There are a number of "bytecode obfuscators" available, both commercial (DashO Pro) and free (RetroGuard). Googling for "Java bytecode obfuscators" will give you a whole list of options.
Note, though, that none of these prevent decompilation; they just arrange things so that the decompiled code is hard to read or understand. Some obfuscators are able to prevent some decompilers from decompiling some statements, just by making them impossible for the decompiler to understand. But it's an "arms race" -- decompilers and obfuscators both keep getting better by turns.