Summary
The CLI fails to start with ExceptionInInitializerError when JAVA_HOME is unset, because a static initializer dereferences the environment variable without a null check.
Surfaced during the pre-release client review.
Ground truth (verified)
btrace-client Main.java:96:
Paths.get(System.getenv("JAVA_HOME"), ...)
When JAVA_HOME is unset, System.getenv returns null, Paths.get(null, ...) throws NullPointerException inside the static initializer. Only IOException is caught, so the NPE escapes as ExceptionInInitializerError and the CLI never starts.
Fix
Guard for a null/blank JAVA_HOME (fall back to java.home system property or emit a clear diagnostic instructing the user to set JAVA_HOME), and broaden the catch to cover the null case.
Severity: MAJOR (CLI unusable in environments without JAVA_HOME). Owner: client team.
Summary
The CLI fails to start with
ExceptionInInitializerErrorwhenJAVA_HOMEis unset, because a static initializer dereferences the environment variable without a null check.Surfaced during the pre-release client review.
Ground truth (verified)
btrace-clientMain.java:96:When
JAVA_HOMEis unset,System.getenvreturnsnull,Paths.get(null, ...)throwsNullPointerExceptioninside the static initializer. OnlyIOExceptionis caught, so the NPE escapes asExceptionInInitializerErrorand the CLI never starts.Fix
Guard for a null/blank
JAVA_HOME(fall back tojava.homesystem property or emit a clear diagnostic instructing the user to setJAVA_HOME), and broaden the catch to cover the null case.Severity: MAJOR (CLI unusable in environments without
JAVA_HOME). Owner: client team.