0

I am trying the Nand2Tetris course, and I got to the point where I want to run and test hdl files with the Hardware Simulator. I downloaded the software suit, followed the instruction below and ran:

# I had a dangling symlink issue at the beginning
# and the full path was apparently the way to solve it
chmod +x ~/.../nand2tetris/tools/HardwareSimulator.sh

I tried to run the script with: ./HardwareSimulator.sh

and received the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-17-openjdk-amd64/lib/libawt_xawt.so
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2393)
    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:384)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170)
    at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:311)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:281)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2398)
    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)
    at HardwareSimulatorMain.main(Unknown Source)

I don't understand what seems to be the problem and why it states (Unknown Source) at the end.

When looking online for a solution I saw it might be a problem with openjdk in this post. I also found this post but it didn't help me much either.

I am a relatively new Linux user currently on pop OS.

I would really love some help as I am unsure what should I do to fix the problem as well as how to continue the course

Thanks in advance.

  • I had trouble with the HardwareSimulator.sh on archlinux: There was no error, but the GUI was white without any features. On a debian installation, I just did `apt-get install default-jdk` and `bash HardwareSimulator.sh` and things worked. – Martin Apr 29 '22 at 06:05
  • Update: The error I had was due to java GUIs not working under Wayland. For me, it worked using an X session – Martin Jul 19 '22 at 13:10

1 Answers1

0

Not a linux user but a useful tactic in these cases is to google the first line of the error message ("Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-17-openjdk-amd64/lib/libawt_xawt.so"), which provides several hints. One of them is to install the missing library, ie: "sudo apt install openjdk-17-jdk"

MadOverlord
  • 1,034
  • 6
  • 11