Skip to content

Commit

Permalink
Runtime initialization of some imageio related classes
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed Oct 23, 2020
1 parent 6312680 commit 9e0a94e
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.quarkus.deployment;

import java.util.Arrays;
import java.util.List;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import io.quarkus.deployment.pkg.steps.NativeBuild;

public class ImageIOProcessor {

@BuildStep(onlyIf = NativeBuild.class)
List<RuntimeInitializedClassBuildItem> runtimeInitImageIOClasses() {
// The following classes hold instances of java.awt.color.ICC_ColorSpace that are not allowed in the image
// heap as this class should be initialized at image runtime
// (See https://github.com/quarkusio/quarkus/issues/12535)
return Arrays.asList(
new RuntimeInitializedClassBuildItem("javax.imageio.ImageTypeSpecifier"),
new RuntimeInitializedClassBuildItem("com.sun.imageio.plugins.jpeg.JPEG$JCS"));
}
}

0 comments on commit 9e0a94e

Please sign in to comment.