foo.jar未标记为可执行文件 [英] foo.jar is not marked as executable

查看:83
本文介绍了foo.jar未标记为可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ubuntu的新手.我正在尝试制作一个简单的Java swing应用程序(简称为foo),该应用程序显示一个问候消息,后跟一个用户名.我正在使用Eclipse.直到此处一切正常,当我按下运行"按钮时,我的应用程序会显示该应用程序没问题.现在我将我的应用程序导出为可运行的jar,但是当我尝试双击生成的jar来执行以下消息时:

I am new to Ubuntu. I am trying to make a simple Java swing app(lets call it foo) that displays a hello message followed by a user name.I am using Eclipse .Till here everything works fine.When I press the "Run" button my app shows app without a problem.Now I export my app as a runnable jar but when I try to double click the generated jar to execute the following message:

Blocked: /usr/bin/java -jar
The file 'home/user/java projects/foo.jar' is not marked as executable.

但是,如果我在Windows中运行此jar,则不会出现任何错误. 有什么解决办法的想法吗?如果可能的话,我想得到详细的答案.

However if I run this jar in windows I get no error. Any ideas how to solve the problem?I would like a detailed answer if possible.

先谢谢您了:)

推荐答案

最后,由于@copeg的评论,我设法通过以下方法解决了我的问题:

Finally thanks to @copeg 's comment I managed to fix my problem by doing:

chmod 774 foo.jar

这篇关于foo.jar未标记为可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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