Java ubuntu 中的 android studio 的 studio.sh 打开权限被拒绝
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23846295/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
studio.sh open permission denied for android studio in ubuntu
提问by user3519322
I downloaded an Android Studio for linux and then tried to run the studio.sh file inside the 'bin' directory as per the instruction said. The terminal showed an error saying something like this:
我下载了一个适用于 linux 的 Android Studio,然后尝试按照说明运行“bin”目录中的 studio.sh 文件。终端显示错误,内容如下:
bash: ./studio.sh: permission denied
The whole Studio bundle was in .tdz format and I extracted the files before accessing via the terminal. What is the main cause for such error? Thank you so much!
整个 Studio 包是 .tdz 格式,我在通过终端访问之前提取了文件。造成这种错误的主要原因是什么?非常感谢!
回答by Niemand
You've probably extracted it as root. Change the owner of the file to you with chowncommand and extract it again, or change the owner of the whole extracted content to you. Example (sudo may be required):
您可能已经以 root 身份提取了它。使用chown命令将文件的所有者更改为您并再次提取它,或者将整个提取内容的所有者更改为您。示例(可能需要 sudo):
sudo chown yourUserName studio.sh
The other way to do it: change privileges with chmod
另一种方法:使用 chmod 更改权限
sudo chmod a+x studio.sh
Beware, the above one gives every registered user privileges to execute studio script.
请注意,上面的一个赋予每个注册用户执行工作室脚本的权限。
回答by robertoprs
Type
类型
sudo ./studio.sh
This should launch android studio with admin privileges. You will need to type your password, assuming you have admin privileges. If you do not have them, you need to contact whoever manages the computer.
这应该以管理员权限启动 android studio。假设您具有管理员权限,您将需要输入密码。如果您没有它们,则需要联系管理计算机的人。
When it launches for the first time, it will ask yo to add a shortcut so it is reachable from the GUI app menu. After that, launching android studio should not require sudo permissions.
当它第一次启动时,它会要求你添加一个快捷方式,以便可以从 GUI 应用程序菜单中访问它。之后,启动 android studio 不需要 sudo 权限。
https://askubuntu.com/questions/421389/where-to-unpack-the-android-studio-filehas good recommendations of where to extract android studio to.
https://askubuntu.com/questions/421389/where-to-unpack-the-android-studio-file对将 android studio 提取到的位置有很好的建议。
回答by Harpreet Singh
Got the same problem. But solved it by following steps:-
遇到了同样的问题。但是通过以下步骤解决了它:-
- Right click on studio.sh and select Properties.
- There go to Permissions.
- Check "Allow Executing file as program"
- 右键单击 studio.sh 并选择属性。
- 那里去权限。
- 勾选“允许将文件作为程序执行”
And you are done.
你已经完成了。
回答by Lucas Breitembach
--make this--
——做这个——
1°
1°
sudo chown root:YOURUSERHERE /dev/kvm
2°
2°
sudo chmod -R 770 /dev/kvm
so you will be allowed to install and run android studio
所以你将被允许安装和运行 android studio
Hope this helps :)
希望这可以帮助 :)
回答by Kazakh
I have the same problem, then i used
我有同样的问题,然后我使用
sudo sh studio.sh
then it`s worked.
那么它的工作。