JetBrains / JetBrains/attachme

Can't debug Gradle process

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
43
Forks
13
PR merge metrics
No merged PRs in 30d

Description

I'd love to be able to use this plugin to debug Gradle plugins and processes spawned by Gradle.

Unfortunately, after running `source ~/.attachme/conf.sh` all Gradle tasks fail with the output:

```shell
* What went wrong:
Unable to determine version for JDK located at /Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home. Reason: Unexpected command output:
Listening for transport dt_socket at address: 53880
/Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home
15.0.2
AdoptOpenJDK
x86_64
OpenJDK 64-Bit Server VM
15.0.2+7
OpenJDK Runtime Environment
15.0.2+7
```

The issue is that Gradle is probing the JVM to determine its version and isn't expecting the "Listening for transport dt_socket at address: 53880" line in the output.

The workaround is to edit `~/.attachme/conf.sh` to switch jdwp to 'quiet' mode:

```
JDWP_ARGS="${JDWP_ARGS:=transport=dt_socket,server=y,suspend=y,quiet=y,address=${JDWP_ADDR}:${JDWP_PORT}}"
```

Would be nice if the workaround was not needed.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.