File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import { ErrorLike } from '../util/error';
14
14
type JvmTarget = { pid : string , name : string , interceptedByProxy : number | undefined } ;
15
15
16
16
const OLD_JAVA_MISSING_ATTACH_CLASS = 'com/sun/tools/attach/AgentLoadException' ;
17
+ const MISSING_ATTACH_LIB_MESSAGE = 'java.lang.UnsatisfiedLinkError: no attach in java.library.path' ;
18
+ const JRE_NOT_JDK_MESSAGE = 'Are we running in a JRE instead of a JDK' ;
17
19
18
20
// Check that Java is present, and that it's compatible with agent attachment:
19
21
const javaBinPromise : Promise < string | false > = ( async ( ) => {
@@ -72,8 +74,13 @@ const javaBinPromise: Promise<string | false> = (async () => {
72
74
// the necessary APIs to attach to remote JVMs. That's inconvenient, but unavoidable & not unusual.
73
75
// Fortunately, I think most active Java developers do have a recent version of Java installed.
74
76
const unusualJavaErrors = javaTestResults . filter ( ( { output } ) =>
75
- ! output . stderr . includes ( OLD_JAVA_MISSING_ATTACH_CLASS ) &&
76
- ! output . stdout . includes ( OLD_JAVA_MISSING_ATTACH_CLASS ) &&
77
+ // Not caused by a known normal not-supported-in-your-env error:
78
+ ! [
79
+ MISSING_ATTACH_LIB_MESSAGE , OLD_JAVA_MISSING_ATTACH_CLASS , JRE_NOT_JDK_MESSAGE
80
+ ] . some ( knownError =>
81
+ output . stderr . includes ( knownError ) || output . stdout . includes ( knownError )
82
+ ) &&
83
+ // And not caused by ENOENT for an invalid Java path:
77
84
! ( 'spawnError' in output && output . spawnError . code === 'ENOENT' )
78
85
) ;
79
86
You can’t perform that action at this time.
0 commit comments