Open
Description
Providers loaded by java.nio.file.spi.FileSystemProvider
(such as BouncyCastleProvider
or SftpFileSystemProvider
) cause native image compilation to fail with No instances of xxx are allowed in the image heap as this class should be initialized at image runtime.
. However, adding --initialize-at-run-time=java.nio.file.spi.FileSystemProvider
to setup results in Error: The class java.nio.file.spi.FileSystemProvider has already been initialized (from command line with 'java.nio.file.spi.FileSystemProvider'); it is too late to register java.nio.file.spi.FileSystemProvider for build-time initialization.
.
You can use this demo branch as a sample.
Run with ./mvnw clean package -Pnative -DskipTests
.