错误:java.io.IOException:CreateProcess错误=193,%1不是有效的Win32应用程序

错误:java.io.IOException:CreateProcess错误=193,%1不是有效的Win32应用程序,java,Java,此代码中有一个错误: String rollno="13f127"; String file="code"; Process p = Runtime.getRuntime().exec("C:\\Users\\Raga\\Documents\\"+rollno+"\\"+file+".py < C:\\Users\\Raga\\Documents\\"+rollno+"\\input.txt"); String rollno=“13f127”; String fi

此代码中有一个错误:

    String rollno="13f127";
    String file="code";
    Process p = Runtime.getRuntime().exec("C:\\Users\\Raga\\Documents\\"+rollno+"\\"+file+".py < C:\\Users\\Raga\\Documents\\"+rollno+"\\input.txt");
String rollno=“13f127”;
String file=“code”;
进程p=Runtime.getRuntime().exec(“C:\\Users\\Raga\\Documents\\\”+rollno+“\\\”+file+”.py
我不知道如何创建这个流程,也不知道这一行有什么问题。请帮助任何人


我在前面看到过这类问题,但在我的问题中,我使用从文件中给出的输入编译python程序。所以我想知道这个有什么不同

您正在尝试执行一个不可执行的python文件

尝试使用“python”(如果已安装python)命令,就像在cmd中执行python脚本一样

例如:

Process p = Runtime.getRuntime().exec("python C:\\Users\\Raga\\Documents\\"+rollno+"\\"+file+".py < C:\\Users\\Raga\\Documents\\"+rollno+"\\input.txt");
processp=Runtime.getRuntime().exec(“python C:\\Users\\Raga\\Documents\\”+rollno+“\\”+file+”.py