Java 実行可能ファイルをビルドするために jlink ツールを使用しようとしています。私は次の方法でそれを使用しています:
jlink.exe --module-path <path-to-modules> --add-modules <my-module-name> --output dist --launcher launch=org.demo/org.demo.Main --strip-debug --compress 2 --no-header-files --no-man-pages
しかし、それは私に次のエラーを与えます:
Error: signed modular JAR <path-to-modules>\bcprov.jdk15on.jar is currently not supported, use --ignore-signing-information to suppress error
「--ignore-signing-information」オプションを追加すると、実行可能ファイルが正常にビルドされますが、次の警告が表示されます。
WARNING: signed modular JAR <path-to-modules>\bcprov.jdk15on.jar is currently not supported
その後、ビルド済みの実行可能ファイルを実行すると、次の例外が発生します。
org.apache.sshd.common.SshException: Failed (NoSuchProviderException) to execute: JCE cannot authenticate the provider BC
at sshd.core/org.apache.sshd.common.future.AbstractSshFuture.verifyResult(Unknown Source)
at sshd.core/org.apache.sshd.client.future.DefaultAuthFuture.verify(Unknown Source)
at sshd.core/org.apache.sshd.client.future.DefaultAuthFuture.verify(Unknown Source)
Caused by: java.util.jar.JarException: Non-Oracle JCE providers may not be linked into the image,they must be provided as signed JAR files.
at java.base/javax.crypto.ProviderVerifier.verify(Unknown Source)
at java.base/javax.crypto.JceSecurity.verifyProvider(Unknown Source)
at java.base/javax.crypto.JceSecurity.getVerificationResult(Unknown Source)
at java.base/javax.crypto.JceSecurity.getInstance(Unknown Source)
at java.base/javax.crypto.KeyAgreement.getInstance(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
私の質問は - 「jlink」ツールで署名付きの jar を使用する方法はありますか、または「Oracle 以外の JCE プロバイダがイメージにリンクされていない可能性があります」というエラーを回避する方法はありますか?