To protect class files from being extracted
Jar2Exe generates exe files from jar files by wrapping binary code around jar files. If "protect" option selected, the class files cannot be extracted from generated exe files. Generated exe uses a special ClassLoader to load protected classes and resources.
Hide and Encrypt
If "protect" option not selected, the generated exe file may be extracted by some compress software.
If "hide protect" option selected, the jar file is hidden and the jar file content cannot be extracted.
If "encrypt protect" option selected, the jar file is encrypted before it is hidden into exe file.
Effects to Your Program
The protection by Jar2Exe will bring 2 changes to your java program:
- Program could not load the bytes of a protected ".class" file, such as by a 'ClassLoader.getResourceAsStream("a/b/c.class");'.
- Program could not enumerate the filenames within a folder in a protected jar file. If some framework try to open a protected jar by ZipFile class, it will fail.
If your spring is configured like "classpath:a/b/*.xml", it will fail and you need to configure them one by one explicitly.
Compatible Mode[since 2.1.3]
The behaviour of the special ClassLoader may be not compatible with some third-party libraries in certain cases. If you meet a problem in running your generated exe files, please try to enable 'compatible mode'.
To enable 'compatible mode', please refer to Protected Resource .
If your program has something to do with ClassLoader, use "Thread.currentThread().getContextClassLoader()" to load protected resources.
See Protected Resource for details.