This is very possible with Class Loaders. But it is still very easy to decode your program. All you have to do is change the bootloader to write all the classes to disk before it loads them into memory using your regular ClassLoader.
Update
If the bootloader is what your users can do, I just need to decompile and replace the bootloader JAR file to dump the classes to disk. Not only that, I'm sure there must be something that can take a JVM memory dump and dump all the loaded bytecode.
If the bootloader is located on a locked machine in which users cannot access, then what example of use are you trying to solve?
The "solution" to these problems:
- Use the advanced Obfuscator, which is designed to break decompilers.
- Prevent access to JAR files. Either through the ACL on the machine, or using the remote server to execute the code that you want to protect. Essentially, this works with web applications. There may be significant amounts of IP or processing that Stackoverflow performs, but we will never have access to server processing as a result of user experience output.
source share