Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)?

like image 797
Daniel Ball Avatar asked Aug 17 '16 19:08

Daniel Ball


People also ask

What can be used to deploy UWP apps?

Microsoft Visual Studio allows you to deploy and debug your Universal Windows Platform (UWP) apps on a variety of Windows 10 devices.

Is UWP a desktop app?

The Universal Windows Platform (UWP) lets you build apps for any Windows device—PCs, Xbox One, HoloLens, and more—and publish them to the Store.

What framework does UWP use?

UWP apps use the Windows Runtime, the native API provided by the operating system. This API is implemented in C++ and is supported in C#, Visual Basic, C++, and JavaScript. Some options for writing UWP apps include: XAML UI and C#, VB, or C++


2 Answers

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

like image 80
Carlos Rafael Ramirez Avatar answered Oct 11 '22 11:10

Carlos Rafael Ramirez


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.).

like image 34
Shai Almog Avatar answered Oct 11 '22 10:10

Shai Almog