我习惯使用 Windows,只需安装 .jar 文件即可。我尝试按照我找到的视频中的说明安装 forge,并在java -jar forge-1.19.2-43.2.0-installer.jar
终端中输入,但收到以下错误消息:
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2633)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2445)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2501)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2700)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2651)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1399)
at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1397)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1396)
at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1429)
at java.desktop/javax.swing.UIManager.getSystemLookAndFeelClassName(UIManager.java:661)
at net.minecraftforge.installer.SimpleInstaller.launchGui(SimpleInstaller.java:166)
at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:147)
我需要做什么来安装 Forge?
答案1
很可能是你安装的headless
java版本有问题,需要的是桌面应用使用的标准版本。
sudo apt install openjdk-11-jdk
这将安装缺失的文件/usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
(以及其他东西),然后你就一切顺利了。