OpenJFX support for 32-bit systems

南笙酒味 提交于 2020-01-23 04:47:06

问题


I would like to build my JavaFX app for Windows x86 arch. So I've downloaded Adopt OpenJdk 32-bit build and used it to create Java Runtime Image. When I'm trying to run application I get the following error:

Loading library api-ms-win-core-console-l1-1-0 from resource failed: java.lang.UnsatisfiedLinkError: C:\Users\admin01\.openjfx\cache\11.0.1\api-ms-win-core-console-l1-1-0.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
java.lang.UnsatisfiedLinkError: C:\Users\admin01\.openjfx\cache\11.0.1\api-ms-win-core-console-l1-1-0.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)

This error occurs because openjfx:javafx-graphics artifact is platform dependent and it includes DLLs compiled for 64-bit arch.

$ file api-ms-win-core-console-l1-1-0.dll
api-ms-win-core-console-l1-1-0.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows

There is no 32-bit OpenJFX version in Maven Central.

Is it possible to get x86 version somewhere? Or how can I build it by myself?


回答1:


Liberica OpenJDK 12 is available for 32-bit Windows and includes OpenJFX. As far as I know it's the only publicly available JDK including 32bit openjfx ref. https://bell-sw.com/pages/java-12

As of right now (April 16th 2019):

  • Zulu OpenJDK not available publicly for 32bit windows plus never got any reply on requests for 32bit
  • Amazon Corretto available for Java 8 only plus not full Javafx (missing webkit libs)



回答2:


You could try building it yourself.
Documentation including instructions can be found here:
https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX

The instructions did not work flawlessly (at least for me).
I had to install the DirectX SDK (from June 2010) and I had to set some more environment variables (WINSDK_DIR and DXSDK_DIR).
Additional information on the build process in general can also be found here:
https://github.com/SkyLandTW/OpenJFX-binary-windows)

For my setup I had to also pass some gradle properties, so my call looked like this:
gradle clean sdk --no-daemon -PWINDOWS_SDK_VERSION=10.0.17763.0 -PWINDOWS_VS_VSINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"

However, note that the "Building OpenJFX" page (see link above) stats a "64-bit OS" as windows platform prerequisites, so 32-bit OpenJFX builds are most probably not officially supported right now...



来源:https://stackoverflow.com/questions/54179851/openjfx-support-for-32-bit-systems

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!