Thales IoT Developer Community
How to obfuscate my Java Code. Benefits
FAQ, March 6, 2014 - 1:13am, 7545 views
Using an obfuscator with your j2me applications is convinient to be able to “obfuscate the code”, and to reduces the total “.jar” file size generated.
Take in consideration that you are programming an embbeded processor with small RAM and FLASH memory compared with a desktop computer.
Using an obfuscator will reduce the use of FLASH memory, and especially the RAM memory.
To provide an idea, an application example takes around 130Kb without obfuscating and 80Kb obfuscating. You can see that the reduction is quite significant.
Where you can download an obfuscator:
Once the file has been downloaded then unzip it inside your Eclipse folder, for example
Then under Windows > Preferences > J2ME > Packaging > Obfuscation you can select the PATH:
Once selected, you can “compile” your file obfuscating it. Instead of making a “Create Package”, to do this we make a “Create Obfuscated Package”.
"it works, but an obfuscating error appeared"
This is because you need to specify the complete path to the JDK and you probably have a JRE. Under Window > Preferences > Java > Installed JREs you can select the appropriate JDK directory. In this case: