I am migrating a project from Java 6 to Java 11. In the project I have the following dependency:
<dependency> <groupId>com.octo.captcha</groupId> <artifactId>jcaptcha</artifactId> <version>1.0</version> </dependency> As part of migration have based the whole project on Spring Boot with version 2.7.18 and removed most of the old libraries. When I try to use the jcaptcha library, I get an error:
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/ImageFormatException
Fix 1: I have tried to change the version of jcaptcha into jcaptcha-all, but then another exception is raising:
java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
Fix 2: I have also updated the ehcache for higher version, but then yet another exception occurred:
[java.io.StreamCorruptedException: unexpected end of block data]
net.sf.ehcache.CacheException: java.io.StreamCorruptedException: unexpected end of block data
I have tried also to shuffle other libraries to find the working solution but so far I did not mage. Is there a way to use com.octo.captcha jcaptcha library in a Java 11 project?