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
6
votes
2 answers

Mathematica & J/Link: Memory Constraints?

I am doing a computing-intensive benchmark using Mathematica and its J/Link Java interface. The benchmark grinds to a halt if a memory footprint of about 320 MB is reached, since this seems to be the limit and the garbage collector needs more and…
D-Bug
  • 666
  • 2
  • 8
  • 19
6
votes
1 answer

Why doesn't the runtime image (assembled by jlink) for my JavaFX application launch and work correctly?

I have a simple JavaFX web browser that is a module. The directory structure of the module is: webBrowser webBrowser/module-info.java webBrowser/webbrowser webBrowser/webbrowser/WebBrowser.java Here is the code to module-info.java module webBrowser…
ktm5124
  • 11,861
  • 21
  • 74
  • 119
6
votes
1 answer

Find the missing module

My question: when building a minimal JRE, how can one make sure that no required module is missing? To illustrate the question, here is an example where I want to build a minimal JRE for my project. Let's assume for this example that logback is my…
assylias
  • 321,522
  • 82
  • 660
  • 783
6
votes
1 answer

Jlink spring boot

I have a simple hello world spring 2 boot app, which runs with full JDK 13. Now I am trying to get this to run with a custom JRE using spring boot. In past when I have need external jars, I have run jdeps -s json-20190722.jar to see what modules I…
ghjghgkj
  • 373
  • 1
  • 3
  • 9
6
votes
0 answers

Is it possible to use jlink on JDK 11 to make a runtime including the Java SE EE modules that were removed?

When I try to include java.xml.bind in my runtime I get an error message: Error: automatic module cannot be used with jlink: java.activation from file:...[url to javax.activation-api-1.2.0.jar in my gradle cache] I'm using these artifacts on the…
swpalmer
  • 3,890
  • 2
  • 23
  • 31
6
votes
1 answer

signed modular JAR with crypto provider cannot be linked into run-time image

I'm trying to use the jlink tool in order to build a java executable. I'm using it in the following way: jlink.exe --module-path --add-modules --output dist --launcher launch=org.demo/org.demo.Main --strip-debug…
5
votes
0 answers

How to calculate list of needed java modules with jdeps?

I'm basically working with a tomcat webapp that has a complex structure, with many jars and classes at several locations and I want to generate a JRE with jlink and its --add-modules option in order to reduce the weight and attack surface of the…
Simon Campano
  • 87
  • 3
  • 11
5
votes
1 answer

Add module descriptor to library with JavaFX and maven

I need to use Reflections in a maven project with JavaFX and I want to use jlink to bundle a minimal JRE. The problem is that I get the following error when running mvn clean compile javafx:jlink: [WARNING] Required filename-based automodules…
dan1st
  • 12,568
  • 8
  • 34
  • 67
5
votes
2 answers

EXCEPTION_ACCESS_VIOLATION after build a windows self-contained application with jdeps + jlink + jpackage

I'm trying to build a bundle (self-contained app) for windows using jdeps + jlink + jpackage. On mac, with the same procedure, I managed to create (following JPackageScriptFX as reference) a fully working self-contained ".app" for this project…
madx
  • 6,723
  • 4
  • 55
  • 59
5
votes
1 answer

java.security.NoSuchAlgorithmException: Algorithm x25519 not available

I am getting a "javax.net.ssl.SSLException: Connection reset" for this piece of code ReadableByteChannel rbc = Channels.newChannel(url.getInputStream()); but only when running under a Java 14 JRE built with jlink from Open JDK 14. The code…
Andrew L
  • 243
  • 1
  • 11
5
votes
2 answers

how to export a javafx-maven project with firebase

for now i have got my project to run on mvn javafx:run. but a module descriptor is required to execute mvn javaFx:jlink. there are some firebase related errors after creating the module info file. some of the imports imports : import…
Eshaka
  • 974
  • 1
  • 14
  • 38
5
votes
2 answers

Two versions of module javafx.base in gradle/JavaFX project

My team is working on a java project. (git repo @ https://github.com/RaiderRobotix/Scouting-Client-FX). We are trying to package it using jlink. The following is displayed when running the jlink task (gradlew jlink). I'm using gradle 6.1.1, with jdk…
Hybras
  • 71
  • 6
5
votes
0 answers

JLink plugin for gradle gives error that file could not be found

I am trying to create a standalone runtime image, as described in this answer. When I try to run the JLink task from the 'Badass JLink" plugin for gradle, I get the following error: Execution failed for task ':prepareMergedJarsDir'. >…
erik p
  • 360
  • 3
  • 15
5
votes
2 answers

Getting Error java.util.zip.ZipException: duplicate entry: classes/META-INF/MANIFEST.MF When Deploying Application using JMod Plugin

Im using OpenJDK9 and created a parent child structure to deploy the app using JLink and JMod. I follow the jigsaw example on Internet to create my structure of App. Before I was getting path must be directory when using JMod 3.0.0-alpha-1, then i…
Aqeel Haider
  • 603
  • 7
  • 24
5
votes
1 answer

How to use launch4j with a Java custom runtime image?

Is it possible to make a bundle/wrapper exe file with Launch4j with a modular java app? The app is modular (jmods), exported with jlink, it doesn't generate any jar, but a custom runtime image (a few folders) with a bat file that runs the command:…
tec
  • 999
  • 3
  • 18
  • 40
1 2
3
17 18