无头模式 裁决

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-23 01:23:49 +08:00
parent f890be0728
commit e3781116dc
4 changed files with 76 additions and 5 deletions

View File

@@ -0,0 +1,19 @@
import java.io.*;
public class TestMain {
public static void main(String[] args) {
try {
Process process = Runtime.getRuntime().exec("cmd /c npm run main",null,new File("D:\\Jisol\\JisolGame\\headless"));
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String content = br.readLine();
while (content != null) {
System.out.println(content);
content = br.readLine();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}