通过 IDE (inteliJ) 运行 Shell 脚本并收到:Linux 的 Windows 子系统没有安装发行版,有什么想法吗?
我的代码:
public class TestScript {
public static void main(String args[]) throws IOException, InterruptedException {
String[] cmd = { "bash", "-c", "ExecutorTest.sh" };
Process p = Runtime.getRuntime().exec(cmd);
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
p.waitFor();
}
}
输出:
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
慕妹3146593
相关分类