Added GraalVM support to pom.xml in a dedicated profile:
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${native.maven.plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<imageName>${imageName}</imageName>
<buildArgs>
<buildArg>--no-fallback</buildArg>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>Used GraalVM tracing agent to capture required runtime methods:
java -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image -jar target/perlonjava-5.42.0.jar examples/life.plThe native image build is not currently viable due to fundamental GraalVM limitations:
- Many Perl runtime methods are optimized out during native image generation
- Runtime class loading is required but not supported by GraalVM native image:
-H:+SupportRuntimeClassLoading is not yet supported.
PerlOnJava requires JVM dynamic features for proper operation. Continue using standard JVM builds:
mvn clean package