When you are deploying a Luciad portfolio-based application, you can choose to obfuscate the Luciad portfolio libraries with ProGuard.

As this is an intricate process, you can already take some precautions to prevent potential glitches before you start obfuscating. If you still run into problems despite those precautions, you can find a couple of suggestions for solutions in this article as well.

How to prevent obfuscation problems

Obfuscation is quite a complex process that involves re-writing the class files. We try to make the process as hassle-free as possible by shipping a tested sample ProGuard configuration for you to use.

By respecting these rules, you can prevent most obfuscation-related problems:

Use the latest version of ProGuard.

ProGuard has its own set of issues and gets updated frequently. It is recommended to use the latest version.

Use the ProGuard configuration files shipped with the product and version that you are using.

Those files are updated regularly. Using the files of another product, or of an older version, will likely result in errors.

Follow the Maven ProGuard plugin configuration used in our Maven tutorial.

The Maven ProGuard plugin is difficult to configure correctly. We recommend following the configuration used in our Maven tutorial. Alternatively, you can set up obfuscation as a separate step in your build pipeline and use ProGuard directly or through Ant.

ProGuard does not support multi-release jars.

Multi-release jars were introduced in Java 9, but are not supported by ProGuard. If your application includes or depends on such jars, you must filter out the alternate versions or ProGuard will complain about duplicate definitions.

Do not shrink or optimize your application.

Shrinking or optimizing your application causes ProGuard to remove what it considers unused code. It discards code too eagerly, however. Using these options in a LuciadLightspeed-based application will cause run-time errors such as java.lang.NoSuchMethodError.

How to resolve obfuscation problems

Check the solutions to some of the possible issues with ProGuard obfuscation.

Get more information

Do not use the -dontwarn option in your ProGuard configuration. If you leave out this option, ProGuard will print warnings for problems that occurred during the obfuscation process. These may already give you a clue about possible solutions.

The log of warnings will also be of help if you still have to get in touch with the Luciad Support Desk Services.

Library jar implements program jar


You may have incorrectly split -injars and -libraryjars.


Make sure that:

  • All Luciad JARs (the JARs with an lcd_ prefix) and your application JARs are marked as -injar

  • All third-party JARs are marked as -libraryjar. Java’s rt.jar and jce.jar must both be specified as libraryjar.



This is most likely caused by turning off the pre-verification option in ProGuard. As of Java 7, pre-verification is required or your application will not run.


Make sure that the -dontpreverify option doesn’t appear anywhere in your ProGuard configuration.

Other errors

Errors caused by ProGuard tend to be non-specific and can have various causes. Some of the most likely causes are listed here.

  • Possible cause: Mixing obfuscated and non-obfuscated versions of the same JAR(s).
    Solution: Verify that the classpath only contains the obfuscated JARs.

  • Possible cause: ProGuard optimization is enabled.
    Solution: ProGuard optimization occasionally causes problems. It’s recommended to disable it with -dontoptimize.

  • Possible cause: rt.jar and jce.jar were not specified as -libraryjar.
    Solution: Make sure that both rt.jar and jce.jar are specified.

Library class …​ depends on program class …​

This warning is thrown if you have incorrectly split your code into injars and libraryjars. Make sure that all Luciad jars (lcd_*.jar) and your own code are specified as injar and other libraries as libraryjar.

Classes in java.lang or javax.crypto cannot be found.

Make sure that you have specified the necessary JDK jars (e.g. rt.jar) and jmods as libraryjar. You might also have to include JavaFX jars.

You encounter NoClassDefFoundErrors, NoSuchMethodErrors, class cast exceptions or similar.

You may be mixing obfuscated and non-obfuscated code. Make sure that your class path includes only obfuscated jars and has no reference to any of the original, non-obfuscated code. Take special care when using wildcards.

proguard/ant/task.properties cannot be found

You may be running ProGuard 7.0.x, which, due to a packaging bug does not include ant support. Either use a different version of ProGuard or download the ProGuard ant jar yourself.

Ask for obfuscation support

Before contacting the Luciad Support Desk Services, take a look at ProGuard’s troubleshooting page. If you encounter an unlisted problem that you are unable to solve, contact the Luciad Support Desk services and provide:

  • A detailed description of the problem, including any stack traces.

  • An explanation of the steps leading to the problem.

  • The ProGuard version you used.

  • Your ProGuard configuration files.

  • The full obfuscation log. Those are all the messages that ProGuard writes to the console.