繁体   English   中英

在 Ubuntu 上使用 launch4j 时出现错误“无法运行程序 bin/windres”

[英]Getting error 'cannot run program bin/windres' while using launch4j on Ubuntu

我使用 swing 创建了一个简单的 GUI 应用程序。 我想为它制作一个.exe文件,以便我可以在 windows 上使用它。 我之前已经为此目的使用了 launch4j。 但是,这一次,我无法将生成的 jar 文件打包成.exe文件。 以下是我收到的完整日志消息:

Compiling resources
Generated resource file...

LANGUAGE 0, 1
2 RCDATA BEGIN "1.8.0_131\0" END
18 RCDATA BEGIN "1\0" END
30 RCDATA BEGIN "2\0" END
1 ICON DISCARDABLE "/home/bilesh/Pictures/icons/Webalys-Kameleon.pics-Apartment.ico"
10 RCDATA BEGIN "You need Java to run this application.\0" END
21 RCDATA BEGIN "http://java.com/download\0" END
8 RCDATA BEGIN ".\0" END
20 RCDATA BEGIN "32\0" END
101 RCDATA BEGIN "An error occurred while starting the application.\0" END
102 RCDATA BEGIN "This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted.\0" END
103 RCDATA BEGIN "This application requires a Java Runtime Environment\0" END
104 RCDATA BEGIN "The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.\0" END
105 RCDATA BEGIN "An application instance is already running.\0" END
23 RCDATA BEGIN "SocietyManagementSystem\0" END
24 RCDATA BEGIN "SocietyManagementSystem\0" END
17 RCDATA BEGIN "true\0" END

net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/home/bilesh/Launch4j/launch4j/bin/windres": error=2, No such file or directory

正如错误所暗示的那样,我认为给定文件夹中缺少相关文件,但事实并非如此。 以下是表示相同的屏幕截图:

截屏

我正在使用Ubuntu 16.04 64 位,我使用的 launch4j 版本是3.9


我查看了这个答案并尝试使用以下命令安装 32 位库:

sudo apt install ia32-libs

但我收到以下错误:

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  lib32ncurses5 lib32z1

E: Package 'ia32-libs' has no installation candidate

所以,我继续安装替换包:

sudo apt install lib32ncurses5 lib32z1

但是在运行launch4j时我仍然不断收到上述错误。 这可以解决吗?

我通过安装软件包libc6-i386gcc解决了 Ubuntu 20.04 上的相同问题。

我通过运行file来发现/lib/ld-linux.so.2的链接来解决这个问题:

jbaxter@vmssaf66e00000G:~/launch4j-plugin-1.5.0.0-workdir-linux/bin$ file windres
windres: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, stripped

相关系统上不存在。

然后在我正在工作的本地系统上运行apt-file

jbaxter@dev-jbaxter:~$ apt-file search /lib/ld-linux.so.2
libc6-i386: /lib/ld-linux.so.2

安装libc6-i386后,出现一条错误消息,指示gcc - 这可以通过安装相应的 package 直接解决。

这发生在 Canonical 提供的 Azure VM 映像上。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM