gpt4 book ai didi

java - 无法将模块添加到 jpackage 创建的应用程序

转载 作者:行者123 更新时间:2023-12-04 22:43:10 25 4
gpt4 key购买 nike

我在将 jpackage 创建的应用程序连接到 websocket 端点时遇到问题。通过我的 IDE 运行时协商的密码在构建的镜像中不可用。看来我遇到了这里描述的问题:https://www.gubatron.com/blog/2019/04/25/solving-received-fatal-alert-handshake_failure-error-when-performing-https-connections-on-a-custom-made-jre-with-jlink/
我现在正在尝试添加 jdk.crypto.cryptoki到我的 jpackage 并不能。
我第一次尝试这个

runtime {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
jpackage {
imageName = 'MyCorpDashboard'
installerName = 'MyCorpInstaller'
appVersion = '0.1.0'
if(org.gradle.internal.os.OperatingSystem.current().windows) {
jpackageHome = 'D:\\Java\\jdk-14' // Needs to be JDK 14
installerType = 'exe'
jvmArgs = ['-Djava.security.debug=access,stack',
'-Dhttps.protocols=SSLv2,TLSv1.2',
'-Djavax.net.debug=ssl:handshake:verbose'
'--add-modules', 'jdk.crypto.cryptoki']
imageOptions = ['--win-console', '--icon','src/main/resources/com/mycorp/ui/dashboard/icon_wh.ico']
installerOptions = ['--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut',
'--vendor', 'My Corp']
} else if (org.gradle.internal.os.OperatingSystem.current().macOsX) {
jpackageHome = '/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/' // Needs to be JDK 14
imageOptions = ['--vendor', 'My Corp',
'--icon','src/main/resources/com/mycorp/ui/dashboard/icon_wh.icns']
}
}
}
但得到
Error occurred during initialization of boot layer
java.lang.module.FindException: Module jdk.crypto.cryptoki not found
我也试过
compileJava {
options.compilerArgs += ["--add-modules", "jdk.crypto.cryptoki"]
}
这也不起作用。
我如何添加这个模块以便它与我的应用程序一起打包?

最佳答案

oi - 发布后我想我现在看到了,在运行时(重新访问 https://badass-runtime-plugin.beryx.org/releases/latest/ 之后)

runtime {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
modules = ['jdk.crypto.cryptoki']
jpackage {
imageName = 'MyCorpDashboard'
installerName = 'MyCorpInstaller'
appVersion = '0.1.0'
if(org.gradle.internal.os.OperatingSystem.current().windows) {
jpackageHome = 'D:\\Java\\jdk-14' // Needs to be JDK 14
installerType = 'exe'
jvmArgs = ['-Djava.security.debug=access,stack',
'-Dhttps.protocols=SSLv2,TLSv1.2',
'-Djavax.net.debug=ssl:handshake:verbose']
imageOptions = ['--win-console', '--icon','src/main/resources/com/mycorp/ui/dashboard/icon_wh.ico']
installerOptions = ['--win-per-user-install',
'--win-dir-chooser',
'--win-menu',
'--win-shortcut',
'--vendor', 'My Corp']
} else if (org.gradle.internal.os.OperatingSystem.current().macOsX) {
jpackageHome = '/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/' // Needs to be JDK 14
imageOptions = ['--vendor', 'My Corp',
'--icon','src/main/resources/com/mycorp/ui/dashboard/icon_wh.icns']
}
}
}

关于java - 无法将模块添加到 jpackage 创建的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62886366/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com