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
4
votes
1 answer

Migration issues concerning OpenJDK 11 & OpenJFX 11 (& Proguard)

we are currently migrating a Java application from Oracle JDK 8 (application code delivered by JNLP) to OpenJDK 11 (application code delivered as runnable along with a Java Runtime). Although we found more or less a working solution in our test…
user27772
  • 522
  • 1
  • 4
  • 18
4
votes
2 answers

Why is maven-jlink-plugin crashing? What's the illegal argument?

After upgrading to Java 10 (from Java 8), I want to test the new linker, so I started using maven-jlink-plugin by adding this: org.apache.maven.plugins maven-jlink-plugin
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
4
votes
1 answer

Can you use jaotc (Java Ahead-of-Time Compiler) with jlink (module assembler/optimizer to create runtime images)?

The goal here is to: Create a runtime image that has it's own stripped down JRE (minimize size) - this is what jlink gives us Create natively executable libraries instead of using byte code (improve load times and hopefully remove the need to…
Sooth
  • 2,834
  • 23
  • 26
4
votes
0 answers

Why does jlink create a launcher that cannot be symlinked in Linux?

I've modularized my Java 9 application after much pain, but now that things seem to be working, I want to create a native launcher for my application. I used jlink to do it. Here's the Gradle task I used to invoked jlink: task jlink(type: Exec) { …
Renato
  • 12,940
  • 3
  • 54
  • 85
4
votes
0 answers

Java 9 (JLink) fails when adding a 3rd party library

EDIT: YOU CAN GO DIRECTLY TO THE 2018-02-13 UPDATE AT THE END OF THE POST FOR UPDATED INFORMATION I can provide full source code as this problem has appeared in my open source project JMarkPad. Find it here The issue Basically: Building always…
Mayuso
  • 1,291
  • 4
  • 19
  • 41
3
votes
3 answers

How to create a Mathematica Notebook in Java?

I am looking for the prototypical 'Hello World' program that creates a Mathematica Notebook file. I have this working program. package graphica; import com.wolfram.jlink.*; /** * * @author Nilo */ public class MathematicaTester { public…
nilo de roock
  • 4,077
  • 4
  • 34
  • 62
3
votes
1 answer

How to build a Java app with gradle and jlink?

Sorry if this questions seems very lost but I am. I created a simple Java 18 Swing application that could be compiled into a jar for distribution. However, I read that this is no longer the preferred way of distributing so I added gradle to my…
leonheess
  • 16,068
  • 14
  • 77
  • 112
3
votes
2 answers

JavaFX 11 Error intializing QuantumRenderer when running custom JRE image on Windows

I have built my app with JavaFX 11 and now I need to distribute it. I have chosen to distribute it in two ways: cross-platform fat-jar (I know, I know, it is discouraged, but that is not the point) and platform specific image created with jlink. I…
3
votes
1 answer

Can't compile my javafx and selenium project due to google autoservice processor ("Unable to get public no-arg constructor")

I'm trying to compile my Instagram bot with maven. It uses javafx for the interface and selenium for the automation, and I've been stuck with this error for a long time. When I try to do mvn clean javafx:jlink it shows me this error: Failed to…
TheAB
  • 31
  • 3
3
votes
1 answer

jlink packages current platform's binaries

I am trying to build cross-platform archives of an application built using Java 11 and packaged with jlink. For the cross-platform packaging I am basing my build on this answer. I have managed to make my Gradle build download the target platform's…
rpsrosario
  • 111
  • 5
3
votes
4 answers

Image from Mathematica to Java

i try to get an Image out of Mathematica. I try to evaluate some Mathematica Code that uses Methods in Packages to generate Graphics. If i paste the Code to a Mathematica Notebook the Graphic is generated correctly. So my Question: How do I get…
Jujo
  • 79
  • 1
  • 5
3
votes
1 answer

How to change the window icon of a JPackage app on Windows?

I'm deploying a self-contained application with JPackage. This is how I compile it for Windows: call "%JAVA_HOME%\bin\jpackage" ^ --type %INSTALLER_TYPE% ^ --dest target/installer ^ --input target/installer/input/libs ^ --name Deshopp ^ …
Allan Juan
  • 2,048
  • 1
  • 18
  • 42
3
votes
1 answer

How is JLINK used

We are studying how to upgrade to Java 9. A new feature is JLINK is to generate our own JRE, that perfectly matches our application. I have some naive questions about it: in which case should we do it? I understand the benefit for a micro-service,…
Rolintocour
  • 2,934
  • 4
  • 32
  • 63
3
votes
1 answer

Custom runtime image for Alpine

I'm trying to create a custom runtime image using the The Badass Runtime Plugin and then execute it on Alpine. But it fails with the following error message. jibcmd_1 | /bin/sh: exec: line 1: ./bin/jibcmd: not found If I do something like docker…
user672009
  • 4,379
  • 8
  • 44
  • 77
3
votes
1 answer

Create a modular JAR from old JAR with deps

I have a modular JavaFX 11 app, that I need to be able to bundle for Linux and Windows. I'm currently using jlink to do so and it works well. I need the bundle to be standalone, as the Java version on the target computers is 1.8 . Now I must add the…
Tim Autin
  • 6,043
  • 5
  • 46
  • 76