How to deploy JavaFX12 app to multiple platforms with same code base

297 Views Asked by At

I followed the instructions to create a "Modular IDE" Project with NetBeans 11 on Windows 10:

https://openjfx.io/openjfx-docs/#IDE-NetBeans

I end up creating a project that looks like this:

enter image description here

I then ran "Clean and Build" (set up jlink+jmod in nebeans) and I get a Windows distribution folder that contains self-running java runtime with all of the dependencies included (around 90 Megs)

enter image description here

Which I can run either through command prompt "HelloFX" or double clicking on "HelloFX.bat"

enter image description here

This is all fine and good. However, my "HelloFX Project" in netbeans is using the Windows JavaFX libraries and Windows Jmods libraries. Which means this process will work if I want to deploy to Windows machines, but not to a Mac. Would I have to create a brand new project for the Mac? Is there no way that I am able to click a button to "Clean and Build for Mac" and "Clean and Build for Windows"? Or is there a way to use the same code base? I basically want to bring a JavaFX 8 project code base into this new structure. Is there a good way to do this?

0

There are 0 best solutions below