2

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?

trilogy
  • 1,214
  • 8
  • 24
  • See the “Cross-building” section at the end of https://stackoverflow.com/a/53453519/1831987 … though I don’t know offhand how to integrate this into a Netbeans project, other than manually altering that project’s build.xml. – VGR Jun 05 '19 at 18:49
  • This is not a matter of the code base, it is a matter of the machine you are doing the build on. If you transfer your code base from windows to a Mac for example, then you can do a build for the Mac on this machine with the same code base. You will have to test your build on each target platform anyway before you can deliver it. – mipa Jun 06 '19 at 08:15
  • @VGR Thanks, I suppose this works if I can get it easily working with NetBeans... – trilogy Jun 06 '19 at 16:10
  • @mipa With Java 8 I didn't need to test for the Mac as others would test for me. But I see your point. Just means I'll have to ask for a Mac now! – trilogy Jun 06 '19 at 16:12

0 Answers0