简体   繁体   English

无法运行程序“/Applications/Utilities/Terminal.app”:错误= 13,权限被拒绝

[英]Cannot run program “/Applications/Utilities/Terminal.app”: error=13, Permission denied

I am currently experiencing substantial complications when running the code below: 我在运行以下代码时遇到了大量的复杂问题:

package practice;

import java.io.IOException;

public class ProgramExecutor {

    public static void main (String [] args){
        try{
            Process p = Runtime.getRuntime().exec("/Applications/Utilities/Terminal.app");
        } catch (IOException e){
            e.printStackTrace();
        }
    }
}

It returns the following error message: 它返回以下错误消息:

java.io.IOException: Cannot run program "/Applications/Utilities/Terminal.app": error=13, Permission denied
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at java.lang.Runtime.exec(Runtime.java:620)
    at java.lang.Runtime.exec(Runtime.java:450)
    at java.lang.Runtime.exec(Runtime.java:347)
    at basicSkills.ProgramExecutor.main(ProgramExecutor.java:9)
Caused by: java.io.IOException: error=13, Permission denied
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:185)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 4 more

How would I go about resolving it. 我将如何解决它。 It appears to be due to a permission issue on my Mac. 这似乎是由于我的Mac上的权限问题。 I have changed the permissions in the Terminal using chmod command with little success. 我使用chmod命令更改了终端中的权限,但收效甚微。 What else could it be? 还有什么呢? Is it possible to run Eclipse as a super user in order to access this file? 是否可以以超级用户身份运行Eclipse以访问此文件?

The path '/Applications/Utilities/Terminal.app' is the path to the Terminal application, which is a directory. 路径'/Applications/Utilities/Terminal.app'是终端应用程序的路径,它是一个目录。 The actual executable Terminal program path is: 实际的可执行终端程序路径是:

/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal

this is the path you need in the exec call. 这是exec调用中需要的路径。

Alternatively use the 或者使用

open -n /Applications/Utilities/Terminal.app

command. 命令。

I was getting this error: java.io.IOException: Cannot run program "/filetransfer.pl": error=13, Permission denied 我收到此错误:java.io.IOException:无法运行程序“/filetransfer.pl”:错误= 13,权限被拒绝

I resolved the issue giving the permission to the filetransfer.pl script file to execute. 我解决了提供filetransfer.pl脚本文件执行权限的问题。 I use the terminal to execute the permission command. 我使用终端执行权限命令。 My problem is resolved. 我的问题解决了。

chmod 777 filetransfer.pl chmod 777 filetransfer.pl

暂无
暂无

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

相关问题 无法运行程序“adb”:错误=13,权限被拒绝 - Cannot run program "adb": error=13, Permission denied 无法运行程序“... / abc.exe”:错误= 13,权限被拒绝 - Cannot run program “…/abc.exe”: error=13, Permission denied 使用sql loader加载数据时出错。 无法运行程序“sqlldr”:error = 13,权限被拒绝 - Error while loading data using sql loader. Cannot run program “sqlldr”: error=13, Permission denied W/System.err:java.io.IOException:无法运行程序“python”:错误=13,权限被拒绝 - W/System.err: java.io.IOException: Cannot run program "python": error=13, Permission denied IntelliJ 说&#39;无法运行程序&#39;/path/to/tomcat/bin/catalina.sh&#39;错误=13 权限被拒绝 - IntelliJ says 'cannot run program '/path/to/tomcat/bin/catalina.sh' error=13 permission denied 通过java程序在IBM云中运行shell命令,将抛出java.io.IOException错误:无法运行program = 13,权限被拒绝 - Running a shell command in IBM cloud through java programme throwing error as java.io.IOException: Cannot run program =13, Permission denied 无法运行程序“ /home/pi/SPI-Py/MFRC522-python/Read.py”:错误= 13,权限被拒绝 - Cannot run program “/home/pi/SPI-Py/MFRC522-python/Read.py”: error=13, Permission denied 无法运行程序,权限被拒绝erro13 Jenkins - Can not run program, permission denied erro13 Jenkins Jenkins和NodeJS插件 - 权限被拒绝错误= 13 - Jenkins And NodeJS Plugin - Permission Denied Error=13 JavaFX java.io.IOException &quot;uptime&quot;: error=13, permission denied - 以普通用户身份运行程序 - JavaFX java.io.IOException "uptime": error=13, permission denied - Running program as regular user
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM