@SuppressWarnings("resource") // Do not close stdin 
	protected ExecInJshell execInJshell(String script) throws IOException {
		String classPath = parseClassPath();
		ProcessBuilder pb = new ProcessBuilder(jshellPath.toString(), "--class-path=" + classPath);

		// If commands come from file, jshell will quit after EOF.
		Msg.info(this, "outFile: " + outFile);
		Msg.info(this, "errFile: " + errFile);

		ResourceFile rf = Application.getModuleDataFile("TestResources", "HelloWorld.class");
		pb.environment().put("OPT_TARGET_CLASSPATH", rf.getParentFile().getAbsolutePath());
		pb.environment().put("OPT_TARGET_CLASS", "HelloWorld");
		pb.environment().put("OPT_SUSPEND", "true");
		pb.environment().put("OPT_INCLUDE", "n");
		//pb.inheritIO();
		pb.redirectInput(ProcessBuilder.Redirect.PIPE);
		pb.redirectOutput(outFile.toFile());
		pb.redirectError(errFile.toFile());
		Process proc = pb.start();
		OutputStream stdin = proc.getOutputStream();
		stdin.write(script.getBytes());
		stdin.flush();
		//stdin.close();
		return new ExecInJshell(proc, this, CompletableFuture.supplyAsync(() -> {
			try {
				if (!proc.waitFor(TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
					Msg.error(this, "Timed out waiting for jshell");
					proc.destroyForcibly();
					proc.waitFor(TIMEOUT_SECONDS, TimeUnit.SECONDS);
					return new JshellResult(true, -1, Files.readString(outFile),
						Files.readString(errFile));
				}
				Msg.info(this, "jshell exited with code " + proc.exitValue());
				return new JshellResult(false, proc.exitValue(), Files.readString(outFile),
					Files.readString(errFile));
			}
			catch (Exception e) {
				return ExceptionUtils.rethrow(e);
			}
			finally {
				proc.destroyForcibly();
			}
		}));
	}
Some snapshot likely to exceed the latest
Ghidra/Test/DebuggerIntegrationTest/src/test.slow/java/agent/java/rmi/AbstractJavaTraceRmiTest.java