Search code examples
javafxcompilationgluonfx

Trouble linking a JavaFX app with GluonFX


I've just tried to create a native app from one of our bigger apps again. While the process itself worked so far (runagent generated the necessary JSON files, the compile was successful) an error occured while linking the app.

Microsoft (R) Incremental Linker Version 14.38.33133.0
Copyright (C) Microsoft Corporation.  All rights reserved.

   Creating library C:\Users\<user>\git\performance\<app>\target\gluonfx\x86_64-windows\<app-name>.lib and object C:\Users\<user>\git\performance\<app>\target\gluonfx\x86_64-windows\<app-name>.exp
ch.cnlab.uxtest.mainkt.obj : error LNK2001: unresolved external symbol Java_com_sun_management_internal_OperatingSystemImpl_getFreeMemorySize0
ch.cnlab.uxtest.mainkt.obj : error LNK2001: unresolved external symbol Java_com_sun_management_internal_OperatingSystemImpl_getTotalMemorySize0
ch.cnlab.uxtest.mainkt.obj : error LNK2001: unresolved external symbol Java_com_sun_management_internal_OperatingSystemImpl_initialize0
C:\Users\<user>\git\performance\<app>\target\gluonfx\x86_64-windows\<app-name>.exe : fatal error LNK1120: 3 unresolved externals

What do I have to add (and where) to get a a ref to the missing internal Java class?

Thanks in advance for any advise.


Solution

  • As José Pereda pointed out, this issue is realted to github.com/gluonhq/substrate/issues/1163

    It can be worked around by adjusting the configuration in Maven.

    <configuration>
      <linkerArgs>
        <arg>management_ext.lib</arg>
        <arg>psapi.lib</arg>
      </linkerArgs>
    </configuration>
    

    Thanks again, José

    And if the execution of the app still failes, one could have a look at my other question: Compiled JavaFX app crashes immediately and silently