gpt4 book ai didi

java - 有没有办法在 IntelliJ IDEA 中使用 jlink 来创建自定义模块化运行时镜像?

转载 作者:行者123 更新时间:2023-12-01 08:39:22 24 4
gpt4 key购买 nike

我正在关注 Project Jigsaw: Module System Quick-Start Guide在 IntelliJ IDEA 2018.2.5 中。在 The linker 之前,我在 IDE 中做的一切都是正确的。部分。 有没有办法在 IntelliJ IDEA 中使用 jlink?

jlink (see JEP 282) is the linker tool and can be used to link a set of modules, along with their transitive dependences, to create a custom modular run-time image (see JEP 220).
- Project Jigsaw: Module System Quick-Start Guide



我找到了 Ability to produce JLink artefacts JetBrains Bug & Issue Tracker 中的问题,但它已经开放 2 年多了,甚至没有描述。

作为一种解决方法,我看到了这个 Is there a maven jigsaw jlink plugin?有趣的问题和最有希望的选择似乎是 Apache Maven JLink Plugin ,但它也已经存在了2年多,还没有发布。

最佳答案

您可以使用 Ant 作为构建工具并指定您自己的 jlink 目标,如下所示:

<target name="link">
<echo message="Creating jlink image in directory = dist\bin\java" />
<exec executable="jlink">
<arg line='--module-path bin;"C:\Program Files\Java\jdk-11.0.1-Linux\jmods";"C:\Users\VTorroni\_libs\hsqldb-2.4.1\modules";"C:\Users\VTorroni\_libs\tinylog-1.3.5\module";"C:\Users\VTorroni\_libs\javax.servlet-api-4.0.1\module\javax.servlet.api-4.0.1.jar" --add-modules pnode --output dist\bin\java --strip-debug --no-header-files --no-man-pages --compress=2' />
</exec>
</target>

关于java - 有没有办法在 IntelliJ IDEA 中使用 jlink 来创建自定义模块化运行时镜像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53230489/

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