我收到错误,我的maven构建工作正常(使用mvn install
:生成的可执行文件在Windows中运行),但是当我尝试直接从IntelliJ运行main时,它正在寻找SWT&# 39; s GTK dlls,当然不正确:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-gtk-4528 in java.library.path
no swt-gtk in java.library.path
Can't load library: C:\Users\brandon\.swt\lib\win32\x86_64\swt-gtk-4528.dll
Can't load library: C:\Users\brandon\.swt\lib\win32\x86_64\swt-gtk.dll
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at edu.cornell.ansci.dairy.econ.ui.MainWindow$.main(MainWindow.scala:175)
at edu.cornell.ansci.dairy.econ.ui.MainWindow.main(MainWindow.scala)
实际上,目录的实际文件内容看起来是正确的,但这不是正在寻找的内容:
brandon@DESKTOP-MU8LD7O:/mnt/c/Users/brandon/.swt/lib/win32/x86_64$ ls
swt-gdip-win32-4528.dll swt-win32-4528.dll
这是Intellij中运行配置的图像(默认JDK是Zulu - 也许我应该尝试安装另一个?):