当文件明显存在时,./gradlew assemble 由于文件丢失而失败

发布于 2025-01-09 05:02:10 字数 1454 浏览 0 评论 0原文

我正在尝试使用以下命令按照此链接中的描述构建 JPostal

./gradlew assemble

但是,该命令产生以下输出,声称文件 C:\x\Program Files\Msys64\usr\share 不存在当它明确存在时:

$ ./gradlew assemble

:buildJniLibaclocal-1.16: error: aclocal: file '/x/Program Files/Msys64/usr/share/aclocal/tcl-tea.m4' does not exist
autoreconf-2.71: error: aclocal failed with exit status: 1
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/JPostal/src/main/jniLibs
configure: error: cannot find required auxiliary files: compile config.guess config.sub ltmain.sh missing install-sh
make: *** No rule to make target 'install'.  Stop.
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildJniLib'.
> Process 'command 'sh'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.844 secs

我可以清楚地看到文件名为tcl-tea.m4 位于目录:C:\x\Program Files\Msys64\usr\share\aclocal

请参见下面的屏幕截图

输入图片描述这里

如果文件明显存在,为什么我会收到此错误?为什么文件会受到歧视?

I'm trying to build JPostal as described in this link using the following command:

./gradlew assemble

However, the command produces the following output claiming the file C:\x\Program Files\Msys64\usr\share does not exist when it clearly does:

$ ./gradlew assemble

:buildJniLibaclocal-1.16: error: aclocal: file '/x/Program Files/Msys64/usr/share/aclocal/tcl-tea.m4' does not exist
autoreconf-2.71: error: aclocal failed with exit status: 1
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Files/JPostal/src/main/jniLibs
configure: error: cannot find required auxiliary files: compile config.guess config.sub ltmain.sh missing install-sh
make: *** No rule to make target 'install'.  Stop.
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildJniLib'.
> Process 'command 'sh'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.844 secs

I can clearly see a file named tcl-tea.m4 in the directory: C:\x\Program Files\Msys64\usr\share\aclocal

See the screenshot below:

enter image description here

If the file clearly exists, why am I getting this error? Why is the file being discriminated against?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稳稳的幸福 2025-01-16 05:02:10

尽管支持这些,但带空格的路径在 Linux 上通常会出现问题。
即使没有build.gradle,路径也明显是错误的;这可能需要转义:

"C:\\x\\Program\ Files\\Msys64\\usr\\share\\aclocal"

其中 \\ 给出 \ ,而 \ 给出


使用 ${File.separator} 将是替代的跨平台方法。

这将在 Windows 上给出 \ ,在 Linux 上给出 /

Despite these are supported, but paths with spaces generally tend to be problematic on Linux.
Even without the build.gradle, the path is obviously wrong; this likely needs to be escaped:

"C:\\x\\Program\ Files\\Msys64\\usr\\share\\aclocal"

Where \\ gives \ and \ gives .


To use ${File.separator} would be the alternate cross-platform approach.

This would give \ on Windows and / on Linux.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文