fix(run): Shorten java command lines too long for the OS (#28) (#45)

Root cause: every java launch inlined the whole classpath into one -cp argument with no "Shorten command line", so long classpaths exceeded CreateProcessW's 32767-char limit (os error 206) before the JVM started.
Fix (IDEA's auto "Shorten command line"): ide-run rewrites a too-long java command line at spawn time — @argfile on JDK 9+ with ASCII paths, otherwise a MANIFEST pathing jar (percent-encoded file: URLs, 72-byte lines); temp files are removed when the process exits. Debug passes the same choice to java-debug's shortenCommandLine.
Siblings covered: Application/Spring Boot, test classpath, Kotlin main, explicit java -cp configs, profiler, PTY launches, Debug.
Verified: unit tests, pathing jar loaded by real JDK 8/11/25, ProcessManager integration test with 3000 entries on JDK 8/17/25. Not verified on Windows.

Claude-Session: https://claude.ai/code/session_01VUYsdXA2nkF5v6zsC93dpn
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-10-27 10:13:31 +08:00
1 джерело de84a643aa
коміт 1127263ea8
12 files changed
+647 -2

No files matched your search

+2
Переглянути файл
@@ -179,6 +179,7 @@ describe("java compile errors", () => {
modulePaths: [],
javaHome: null,
javaExec: null,
shortenCommandLine: null,
};
it("lists the first errors, counts the rest and adds hints", () => {
@@ -204,6 +205,7 @@ describe("java command lines", () => {
modulePaths: [],
javaHome: "/jdk21",
javaExec: "/jdk21/bin/java",
shortenCommandLine: "none",
errors: [],
errorCount: 0,
hints: [],