Questions tagged [jlink]

jlink is a tool used in Java 9 or higher to assemble and optimize a set of modules and their dependencies into a custom runtime image. The tag can be used along with java9 or above tag mostly.

The several options used by the tool are documented here.. Its primary syntax is as follows:

jlink [options] --module-path modulepath --add-modules mods --output path
268 questions
48
votes
3 answers

How do I upgrade to jlink (JDK 9+) from Java Web Start (JDK 8) for an auto-updating application?

Java 8 and prior versions have Java Web Start, which auto-updates the application when we change it. Oracle has recommended that users migrate to jlink, as that is the new Oracle technology. So far, this sounds good. This comes with a host of…
Henry Crutcher
  • 2,137
  • 20
  • 28
35
votes
3 answers

SSLHandshakeException with jlink created runtime

I've got a dropwizard app, which runs fine with the standard JRE. I've tried creating a runtime using jlink which is considerably smaller: /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin/jlink --no-header-files --no-man-pages…
rich
  • 18,987
  • 11
  • 75
  • 101
32
votes
2 answers

Create Java runtime image on one platform for another using Jlink

I created runtime image using jlink on my Linux machine. And I see linux folder under the include folder. Does it mean that I can use this runtime image only for Linux platform? If yes, are there any ways to create runtime images on one platform for…
27
votes
1 answer

Using jlink with automatic modules

I have an explicit modular project which is dependent on an automatic module; e.g. on java.activation. Is it still possible to use jlink? See this module-info.java: module hello { requires java.activation; } Then jlink can't add the module: $…
Jonku
  • 383
  • 3
  • 7
26
votes
1 answer

Java 11 JLink getting error: automatic module cannot be used with jlink: com.microsoft.sqlserver.jdbc from file

I'm trying to add a JDBC connector module to my project with Java 11. I downloaded the MSSqlServer JDBC driver 7.2 for Java 11 https://www.microsoft.com/en-us/download/details.aspx?id=57782 I added the module : requires…
trilogy
  • 1,738
  • 15
  • 31
18
votes
1 answer

How do I run images generated by JDK 9 jlink?

I follow the Jigsaw quickstart here. I successfully ran the jlink command given: jlink --module-path $JAVA_HOME/jmods:mlib --add-modules com.greetings --output greetingsapp That produces a "runtime image" which is an exploded directory structure…
clay
  • 18,138
  • 28
  • 107
  • 192
18
votes
2 answers

How to create cross platform executables for JDK9 application using JLink command

I am trying to create cross platform / platform independent executables for my JAVA-9 application / project jigsaw. I think jlink command will create only platform specific executable/runtime.
16
votes
2 answers

When JRE was completely discontinued as a separate offering?

Starting from Java 9 the module system was introduced, making provision of JRE separately redundant. Through, it seems that it was still possible to download it. For example, from here now Java 9 archive Also, here it's only stated that…
anasmi
  • 2,562
  • 1
  • 13
  • 25
14
votes
1 answer

Is there any way to use jlink in IntelliJ IDEA to create a custom modular run-time image?

I'm following the Project Jigsaw: Module System Quick-Start Guide in IntelliJ IDEA 2018.2.5. I did everything right in the IDE until The linker section. Is there any way to use jlink in IntelliJ IDEA? jlink (see JEP 282) is the linker tool and can…
lcnicolau
  • 3,252
  • 4
  • 36
  • 53
12
votes
2 answers

What does the jlink option compress do?

What does the jlink compress option do? the oracle documentation isn't very elaborated about this: Enable compression of resources: 0: No compression 1: Constant string sharing 2: ZIP What are the resources which getting compressed? Is there any…
matanper
  • 881
  • 8
  • 24
11
votes
1 answer

"Received fatal alert: handshake_failure" in jlinked JRE

My Java program sends requests by java.net.http.HttpClient (Java 11). It works when I am running it in Eclipse on OpenJDK 11's JRE. On custom jlinked JRE, I get an error: java.io.IOException: Received fatal alert: handshake_failure I suppose the…
janzdanowski
  • 111
  • 1
  • 4
11
votes
0 answers

`jlink` in java9 does not save resources in the exploded directory?

I am a little bit confused about jlink. I am able to compile my source files and then use jlink with the following command jlink -p $JAVA_HOME/jmods:mymods: \ --add-modules com.myModuleApp \ --output…
saqe hi
  • 181
  • 2
  • 8
10
votes
2 answers

Generate a runtime image with JLink using 3rd party jars

I'd like to create a Java 9 runtime image that contains 3rd party jars. I have made a simple Java project (let's call this Example) to call a utility jar (let's call this ExampleUtil.jar). Example contains the module-info.java in the src directory…
Steven Hung
  • 176
  • 1
  • 5
10
votes
4 answers

Is there a maven jigsaw jlink plugin?

Does maven have a plugin for the new Java 9 jlink I have searched online but have not been able to find anything official from the maven team.
ams
  • 60,316
  • 68
  • 200
  • 288
9
votes
1 answer

Calling ImageJ from Mathematica

From Mathematica, I wish to pass an image to an ImageJ plugin and get the result sent from ImageJ to Mathematica. JLink is the tool that will help, but I am familiar neither with it nor with ImageJ (making it hard to leverage existing related…
Matthias Odisio
  • 2,038
  • 12
  • 19
1
2 3
17 18