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
1
vote
0 answers

javac package not found or does not exist

I have a project written in Java 12 (fairly new to java9+ and using modules) and I want to use jlink to create a custom runtime image. I also want to use apache.commons.cli as a 3rd party library for my project. How can I make use of automatic…
npabs18
  • 167
  • 2
  • 10
1
vote
0 answers

How can I know which module should be import into java runtime image?

I'm running my simple application within java runtime image, so I write a dockerfile to create a java runtime image and build a docker image based it. But when I start it, a ClassNotFoundException exception was…
Yue Gu
  • 61
  • 6
1
vote
0 answers

JavaFX, Maven: Alternatives to JLink

Currently I'm trying to create a runnable jar for my maven project. The problem is, that I use the automatic module itextpdf, which apparently cannot be used with jlink. Are there alternatives for creating a runnable jar with javafx and maven in…
Lenny Will
  • 549
  • 1
  • 4
  • 11
1
vote
1 answer

Modular OpenJDK11 Java image can't find dynamic libraries (e.g. libjava.so) on Linux

I have compiled a modular Java application using OpenJDK 11.0.2 on Windows 10. I have downloaded the linux OpenJDK 11.0.2 jmods and I have used them to create a run-time image using jlink. I have copied the image to a CentOS 6.10 VM, and if I try to…
1
vote
4 answers

How to run jlink-generated Java runtime image without CMD window?

I've created Java runtime image for a simple OpenJFX application. In order to run this app, jlink auto-generated two lauch scripts under %image_path%/bin directory. This how it looks like (the one for Windows): @echo off set JLINK_VM_OPTIONS= set…
Evan
  • 649
  • 1
  • 9
  • 22
1
vote
0 answers

spring with jlink, moditect and java 11

thanks to pupeno for his precedent work on spring and moditect that helped me for most of my problem on the subject, however I'm blocked a bit further that he was. my problem is the illegal access exception my poc is available on github I used to…
yboompook
  • 21
  • 5
1
vote
0 answers

XMLBeans change default generated .xsb files location

OK so I have a main application that uses XMLBeans 3.0. I'm trying to create a self contained JVM using Java10 and Jlink. So I use scomp command to generate my Java classes based on some XSD file and I name this JAR say custom.jar. I opened…
Marquinio
  • 4,601
  • 13
  • 45
  • 68
1
vote
0 answers

Does JMOD Architecture Affect Javac Generated Class Files

I am compiling a Java 11 application, then linking for various architectures by calling the jlink command. Does the architecture of the jmod files used for the javac command affect the output in any way? Is it well-defined behavior to compile…
Jeff G
  • 4,470
  • 2
  • 41
  • 76
1
vote
1 answer

How do I update my JRE (or Runtime Image) from my Java application?

I have an application that consists of a JRE (or custom runtime image, as the jlink docs call it), a JAR file, and a method to run the JAR on the JRE (either a bash or batch file or an exe or .app package). I want to send out updates for the…
Alex - GlassEditor.com
  • 14,957
  • 5
  • 49
  • 49
1
vote
0 answers

Java's --add-export not having an effect during jlinking

My application needs access to a class that is not exported, com.sun.webkit.network.CookieManager, so, when compiling it I added this option: --add-exports=javafx.web/com.sun.webkit.network=tech.flexpoint.dashman The full maven-compiler-plugin…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
vote
1 answer

What's wrong with this module definition for spring.core?

I'm trying to start using Java's new module system as well as jlink, for which I'm using the ModiTect Maven plugin. I'm creating module-info.java files for each of my dependencies that do not define them yet, so that jlink can properly do it's…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
vote
0 answers

java9: IllegalArgumentException using jlink

Im exploring java9 and Im tring to create a custom jre following this link. But Im getting IllegalArgumentException.Below is my folder structure after compilation . out |->moduleA | |->module-info.java | |->pkg1 | …
george
  • 339
  • 3
  • 12
1
vote
0 answers

Jlink is unable to derive module descriptor?

I have a hello-world application that I have compiled into a .jar. public class Main { public static void main(final String[] args) { System.out.println("Hello, world. "); } } Now I would like to use JLink to create a self-contained…
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
1
vote
1 answer

Does jlink still require obfuscation (i.e. can a decompiler be run on the modules file)?

In Java 8 I needed to obfuscate jar/class files for an application. I'm migrating this application to Java 10 and I'm also updating the build process to use modules so that we don't have to provide the full JRE. When I compile (javac) with modules…
Sooth
  • 2,834
  • 23
  • 26
1
vote
0 answers

Java 9 - how to recompile .jar library with module-info

I read that to add .jar libraries as dependency in java9 modules, we just need to include them in --module-path and they will be converted to 'Atomatic Modules' However when I try to use jLink, I still got the error: Error: module-info.class not…
Tiago Santos
  • 489
  • 5
  • 16