How can I add Java JDK/JRE to my apps installer package for MS Store

Martin Kasl 5 Reputation points
2023-07-26T07:22:03.1366667+00:00

Hi all,

I'm pretty new to the app deployment, but I went through a lot of documentation and forums an I wasn't able to find out how to create MSI/MSIX installer package for Java app including JDK/JRE in the package. My Java app (one exe + one jar file) needs OpenJDK + JXbrowser + one specific dll to be able to run. That is not an issue when I create usual MSI installer with Advanced Installer and everything works just fine. But when I used Windows Application Certification Kit to prepare for publishing my app on Microsoft Store it showed me few errors. Long story short it doesn't like to have OpenJDK and the rest in the package. There is no way I can make my app work without that, so I'm wondering what is the best practice to make this work for MS Store? I searched for few days for solution, but I didn't find any working solution yet. Could you please advice me how to correctly package those Java dependencies to my MSI/MSIX installer together with my app?

Thank you in advance and have a great day.

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,495 questions
Microsoft Partner Center
Microsoft Partner Center
A Microsoft website for partners that provides access to product support, a partner community, and other partner services.
1,005 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Limitless Technology 44,386 Reputation points
    2023-07-26T15:21:56.63+00:00

    Hello Martin,

    Thank you for your question and for reaching out with your question today.

    Creating an MSI/MSIX installer package for a Java application that includes the JDK/JRE and other dependencies can be a bit challenging, especially when trying to publish it on the Microsoft Store. Here are some potential approaches you can consider to package your Java app correctly:

    1. MSIX Packaging Tool (Recommended):

    The MSIX Packaging Tool is designed to help developers package their traditional desktop applications into the MSIX format, which is the modern deployment package for Windows 10 and the Microsoft Store. This tool can be used to repackage your existing MSI installer or your Java application.

    To use the MSIX Packaging Tool, you'll need to have a clean system (virtual machine or physical) where you can install your application along with its dependencies (OpenJDK, JXbrowser, and the specific DLL). Once everything is set up and working correctly, you can run the MSIX Packaging Tool to capture the changes and create an MSIX package out of it.

    1. Install4j:

    Install4j is a multi-platform Java installer builder that provides support for creating Windows installers, including MSI installers. It allows you to bundle the JRE, additional DLLs, and other dependencies within the installer package. While it's not an MSI/MSIX specifically, it can create installer packages suitable for distribution.

    1. JLink (Java Linker):

    JLink is part of the OpenJDK, and it allows you to create custom runtime images that contain only the necessary modules for your Java application to run. This can significantly reduce the size of the Java runtime bundled with your application. After creating the custom runtime image, you can package it along with your application and other dependencies using tools like Install4j.

    1. AdoptOpenJDK's JLink MSI Installer:

    AdoptOpenJDK has an experimental project that provides an MSI installer for JREs created with JLink. You can find more information about this project on their GitHub repository. However, do note that this is still experimental and may not be suitable for all use cases.

    Keep in mind that while bundling the JRE with your application can simplify the installation process, it also means that your application won't benefit from any potential security updates or improvements that might be provided by the system-installed JRE. Additionally, Microsoft Store has specific guidelines and requirements for apps, so it's essential to ensure your application complies with those guidelines to successfully publish it on the store.

    Lastly, always thoroughly test your MSI/MSIX installer on different systems to ensure it works correctly and doesn't introduce any conflicts or compatibility issues with other software.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    If the reply was helpful, please don’t forget to upvote or accept as answer.

    2 people found this answer helpful.
    0 comments No comments

  2. Martin Kasl 5 Reputation points
    2023-08-16T09:39:39.4866667+00:00

    Hi,

    thank you very much for your answer. I managed to create MSIX installer of my app with OpenJDK included in package and it works just fine when I install it locally. Since there is very limited info about this topic directly from Microsoft, I will have to try my luck and try to publish my app as it is and hope it will go through certification process or at least someone from MS will give me a hint how to solve any possible issue.

    Anyway I will try your suggestions to make the JRE with just necessary files to make the package as small as possible.

    Thank you and have a great day ;)

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.