foo.jar is not marked as executable

不打扰是莪最后的温柔 提交于 2021-01-28 18:05:48

问题


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.

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.

Thanks in advance :)


回答1:


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

chmod 774 foo.jar



回答2:


Have you tried the unmask config?

The umask command defines the default permissions for newly created files based on the "base" permissions set defined for files and directories.

Try to check it out: https://www.digitalocean.com/community/tutorials/linux-permissions-basics-and-how-to-use-umask-on-a-vps#umask



来源:https://stackoverflow.com/questions/38382459/foo-jar-is-not-marked-as-executable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!