简体   繁体   English

无法在 MacOS 中执行本机二进制文件?

[英]Unable to execute native binaries file in MacOS?

I have found a Java application repository on GitHub which provides the application in JAR format and in the native binary format for different operating systems such as MacOS, Windows, Linux. I have found a Java application repository on GitHub which provides the application in JAR format and in the native binary format for different operating systems such as MacOS, Windows, Linux.

I am able to execute the JAR file using the java -jar command but I would like to run the native binary file so users can execute it without installing the Java in their system.我可以使用java -jar命令执行 JAR 文件,但我想运行本机二进制文件,以便用户无需在系统中安装 ZD52387880E1EA22817A7Z2D375921381 即可执行它。

Can someone please inform me how can I run the binary file on Macos?有人可以告诉我如何在 Macos 上运行二进制文件吗? I tried to search and found the command chmod +x name-of-binary but this command does not do anything.我试图搜索并找到命令chmod +x name-of-binary但是这个命令没有做任何事情。

I am really new to this and do not have much idea about this so any suggestion would be really helpful.我对此真的很陌生,对此并没有太多想法,所以任何建议都会非常有帮助。

The most simple way would be to either open a terminal and manually running the binary, like so:最简单的方法是打开终端并手动运行二进制文件,如下所示:

./<name-of-file>

This would only work if you are running the file in a user who has execution privileges on that file.仅当您在对该文件具有执行权限的用户中运行该文件时,这才有效。 if you run into trouble with priviliges, that's where I would use chmod.如果您遇到特权问题,那我会使用 chmod。 If you need any more specific help, I would recommend posting the link to that GitHub repo for us to look at, and telling us what is it that it should do.如果您需要任何更具体的帮助,我建议您发布指向该 GitHub 存储库的链接供我们查看,并告诉我们它应该做什么。

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

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