|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Using Java-11-jdk's jlink.exe on com.ibm.mq.allclient.jar |
« View previous topic :: View next topic » |
Author |
Message
|
bloehle13 |
Posted: Wed Jan 27, 2021 11:18 am Post subject: Using Java-11-jdk's jlink.exe on com.ibm.mq.allclient.jar |
|
|
Newbie
Joined: 27 Jan 2021 Posts: 6
|
TLDR: com.ibm.mq.allclient.jar is not an explicit Java module, which is causing problems when building an executable with jlink.exe
As we know, Java 9 introduced the use of modules to the Java landscape. I have an MQ related desktop application written in JavaFX that I updated to use Java 11 and the new module system. The com.ibm.mq.allclient.jar is a dependency of the program, so like all dependent jar files in the module system, is put onto the module path of the program. Java resolves com.ibm.mq.allclient.jar as an automatic module, and I am able to run as an runnable jar file no problem.
However, a runnable jar file with dependencies is not self contained, and anyone who wishes to run the program must also have the required dependencies on their machines. jlink.exe is a program that comes in the Java 11 jdk which allows you to package any runnable jar file into a proper .exe file with all required dependencies packaged with it. So I chose to use jlink.exe for this use case.
Here's the catch: jlink.exe does not work if you have any automatic modules on your module path (which com.ibm.mq.allclient.jar is). According to the com.ibm.mq.allclient.jar documentation, version 9.2.0.1 of com.ibm.mq.allclient.jar is Java 11 supported. Yet, it has not been updated to support the module model introduced in Java 9.
Has anyone had any success packaging a Java program into an exe using the com.ibm.mq.allclient.jar file as a module? Is this a flaw/bug with the jar file itself? Should I raise a ticket with IBM? |
|
Back to top |
|
 |
RogerLacroix |
Posted: Wed Jan 27, 2021 3:54 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
bloehle13 |
Posted: Thu Jan 28, 2021 4:53 am Post subject: |
|
|
Newbie
Joined: 27 Jan 2021 Posts: 6
|
Thank you for the reply RogerLacroix
Yes, I did. That's how I have it working as a runnable jar file.
If you look inside any module .jar file, you'll see a module-info.class file in the root directory. The com.ibm.mq.allclient.jar is lacking this, so Java makes it into an automatic module when placing it on the module path and adding it to the --add-modules parameter, which jlink.exe does not allow.
Again, this issue isn't about getting the java code to run, it's an issue of getting it to package into an easily distributed .exe file with the native jdk packager jlink |
|
Back to top |
|
 |
tczielke |
Posted: Thu Jan 28, 2021 6:40 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
It probably would be a good idea to open a ticket with IBM and ask about this feature. This is my assumption, but it looks like Java 11 support for IBM MQ was added at MQ 9.2 to support TLS 1.3. I don't believe the Java 8 JSSE supported TLS 1.3 at the time of the release of MQ 9.2. So possibly what you are looking for here at Java 11 is just not supported yet by IBM MQ. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
bloehle13 |
Posted: Thu Jan 28, 2021 8:40 am Post subject: |
|
|
Newbie
Joined: 27 Jan 2021 Posts: 6
|
Thank you for the reply tczielke
I'll open a ticket with IBM and reply with what they say. I think your explanation is very plausible. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|