Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:110)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)
Caused by: java.lang.ClassCastException: class sun.awt.image.MultiResolutionCachedImage cannot be cast to class java.awt.image.BufferedImage (sun.awt.image.MultiResolutionCachedImage and java.awt.image.BufferedImage are in module java.desktop of loader 'bootstrap')
at clip2dataurl.ClipToDataUrl.getImageFromClipboard(ClipToDataUrl.java:83)
at clip2dataurl.ClipToDataUrl.main(ClipToDataUrl.java:45)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
... 2 more
This happens with both an image file and image data in the clipboard. Converting plain/text in clipboard works as expected. Tested with macOS Ventura 13.3.1.
Calling
java -jar Clip2DataUrl.jar
gives:This happens with both an image file and image data in the clipboard. Converting plain/text in clipboard works as expected. Tested with macOS Ventura 13.3.1.