Can a Java Swing desktop application be converted to a UWP centennial app (AppX)?
Asked Answered
S

4

7

I have been reading about project centennial (https://msdn.microsoft.com/windows/uwp/porting/desktop-to-uwp-root#preparing-your-desktop-app-for-conversion-to-uwp), and it occurs to me that there are many legacy line-of-business apps that are written in Java (not to mention Python/Tkinter, insert language/gui toolkit here, etc).

I can see a benefit in being able to market/distribute these through the Windows store (either internally for an enterprise or to the general public).

I was wondering if it is possible to turn a Java application into an AppX bundle (possibly using something like launch4j as an in-between step)?

Stavros answered 17/8, 2016 at 19:58 Comment(0)
C
12

It is possible, using Project Centennial. Just do the conversion process using the Desktop App Converter using your installer in silent mode and that's it.

You can also use the installerless mode, just put everything (your app and jre) in a folder, create an exe which will call your java program, create your manifest and call makepappx. Everything is in the documentation. And the process is very similar to deploy java applications to Mac Store.

UPDATE

Due to the lack of information out there about packing Java applications for Windows Store, I created an simple skeleton using a demo app bundled in the JDK called SwingSet to ease a lot the process. Please check it: https://github.com/crramirez/uwp_bridge_java and contribute with your own needs to have a good starting point.

I also published a Java application to the store, so this procedure works.

Regards

Cushitic answered 12/5, 2017 at 20:12 Comment(0)
C
4

No you can't.

The installer part would be easy but those are just wrappers around the JRE. The problem is that the JRE (the actual VM) is too complex for UWP and uses a lot of low level API's that just can't be ported.

The only way I know of getting Java apps onto UWP is Codename One which is an open source project and a commercial entity (and my employer). Notice you will need to adapt your code to use the Codename One API which is inspired by Swing but quite different (and better).

A side benefit would be portability to all mobile devices (iOS, Android etc.).

Crossed answered 18/8, 2016 at 8:3 Comment(0)
F
0

You can always use Install4J to create Multi Platform Java App installer and distribute your application.

Farant answered 18/8, 2016 at 6:24 Comment(0)
U
0

If you already have an installer for you application you can use MSIX Packaging Tool to repackage it into MSIX format. You can run your desktop application installers through this tool and obtain an MSIX package that you can install on your machine or upload to the Microsoft Store.

Desktop App Converter was deprecated.

Understate answered 17/11, 2021 at 15:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.