ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ Java / JMSUsing Java-11-jdk's jlink.exe on com.ibm.mq.allclient.jar

Post new topicReply to topic
Using Java-11-jdk's jlink.exe on com.ibm.mq.allclient.jar View previous topic :: View next topic
Author Message
bloehle13
PostPosted: Wed Jan 27, 2021 11:18 am Post subject: Using Java-11-jdk's jlink.exe on com.ibm.mq.allclient.jar Reply with quote

Newbie

Joined: 27 Jan 2021
Posts: 3

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
View user's profile Send private message
RogerLacroix
PostPosted: Wed Jan 27, 2021 3:54 pm Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3188
Location: London, ON Canada

Did you put "com.ibm.mq" parameter for the "--add-modules" option and the path to "com.ibm.mq.allclient.jar" in the "--module-path" option?

You can try & follow the instructions here:
https://medium.com/azulsystems/using-jlink-to-build-java-runtimes-for-non-modular-applications-9568c5e70ef4

where it talks about adding 3rd party JAR files.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
bloehle13
PostPosted: Thu Jan 28, 2021 4:53 am Post subject: Reply with quote

Newbie

Joined: 27 Jan 2021
Posts: 3

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
View user's profile Send private message
tczielke
PostPosted: Thu Jan 28, 2021 6:40 am Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 911
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
View user's profile Send private message
bloehle13
PostPosted: Thu Jan 28, 2021 8:40 am Post subject: Reply with quote

Newbie

Joined: 27 Jan 2021
Posts: 3

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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSUsing Java-11-jdk's jlink.exe on com.ibm.mq.allclient.jar
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.