File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,20 @@ import { commandExists } from '../util';
10
10
11
11
type JvmTarget = { pid : string , name : string , interceptedByProxy : number | undefined } ;
12
12
13
- // Check that Java is present, and that it's possible to run list-targets
13
+ // Check that Java is present, and that it's compatible with agent attachment:
14
14
const isJavaAvailable = commandExists ( 'java' ) . then ( async ( isAvailable ) => {
15
15
if ( ! isAvailable ) return false ;
16
16
17
17
const result = await spawnToResult (
18
18
'java' , [
19
+ '-Djdk.attach.allowAttachSelf=true' , // Required for self-test
19
20
'-jar' , OVERRIDE_JAVA_AGENT ,
20
- 'list-targets '
21
+ 'self-test '
21
22
]
22
23
) ;
23
24
24
- // If Java is present, but it's working, we report it. Hoping that this will hunt done
25
- // some specific incompatibilities that we can better work around/detect.
25
+ // If Java is present, but it's not working, we report it. Hoping that this will hunt
26
+ // down some specific incompatibilities that we can better work around/detect.
26
27
if ( result . exitCode !== 0 ) {
27
28
console . log ( result . stdout ) ;
28
29
console . log ( result . stderr ) ;
You can’t perform that action at this time.
0 commit comments