等价于Mac上可双击的.sh和.bat吗? [英] Equivalent of double-clickable .sh and .bat on Mac?

查看:241
本文介绍了等价于Mac上可双击的.sh和.bat吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在分发一个Java程序,我希望在该Java程序中运行可双击文件

I am distributing a Java program where I want a double-clickable file to run

java -cp MyProgram.jar;MyLib.jar my.program.Main

在Windows上,我仅分发.bat文件,对于* nix,是可执行的.sh文件.问题是,双击.sh文件只会在Mac上的文本编辑器中将其打开.对于Mac,我该怎么办?

On Windows I simply distribute a .bat file, for *nix an executable .sh file. Problem is, double-clicking the .sh file just opens it up in a text editor on Mac. What should I do for Mac?

推荐答案

在Mac上,有一个特定的扩展名,可以通过双击它们来执行Shell脚本:这是.command.

On mac, there is a specific extension for executing shell scripts by double clicking them: this is .command.

这篇关于等价于Mac上可双击的.sh和.bat吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆