Institute-for-Future-Intelligence / multiphysics

Interactive Multiphysics Simulation for Everyone
https://intofuture.org/energy2d.html
GNU Lesser General Public License v3.0
58 stars 29 forks source link

OpenJDK missing libawt_xawt.so #19

Open DuncanLithgow opened 1 year ago

DuncanLithgow commented 1 year ago

I'm not sure who should handle this or help with this. But I can't work it out. I see nowhere a way to install missing elements to OpenJDK.

I'm running Fedora GNU/Linux 37 and have installed OpenJDK JRE and JDK

My understanding is that libawt_xawt.so is needed for drawing gui windows, so of course this graphical program won't start.

charxie commented 1 year ago

I have no idea. Can you try to run the jar file from this website?https://intofuture.org/energy2d.html

DuncanLithgow commented 11 months ago

Hi Charlie. I'm using the file from that site.

Here's some more info about what is happening in Fedora 38 with OpenJDK 17

It seems it can't fnd/access /usr/lib/jvm/java-17-openjdk-17.0.8.0.7-1.fc38.x86_64/lib/libawt_xawt.so

[... ~]$ java -jar energy2d.jar Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-17-openjdk-17.0.8.0.7-1.fc38.x86_64/lib/libawt_xawt.so at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398) at java.base/java.lang.Runtime.load0(Runtime.java:755) at java.base/java.lang.System.load(System.java:1953) at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174) at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315) at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:285) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2403) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818) at java.base/java.lang.System.loadLibrary(System.java:1989) at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1392) at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1390) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1389) at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1427) at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1401) at java.desktop/java.awt.Component.<clinit>(Component.java:624) [... ~]$

Is there any useful information there?

DuncanLithgow commented 11 months ago

Could something here be the problem? https://www.tutorialspoint.com/how-to-handle-java-lang-unsatisfiedlinkerror-in-java

"UnsatisfiedLinkError is caused by a number of factors, such as missing native libraries or library paths configured incorrectly, outdated library versions or dependencies that the native code requires."

charxie commented 11 months ago

I currently do not have a Linux machine for testing. I am still hoping that we will eventually convert this to a Web app instead of Java, which is old.

DuncanLithgow commented 11 months ago

If you want to make energy2d windows/linux cross platform you could run an Ubuntu USB persistent live environment as described here https://itsfoss.com/ubuntu-persistent-live-usb/

"Linux on a stick"