Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't debug Gradle process #11

Open
big-andy-coates opened this issue Oct 22, 2022 · 0 comments · May be fixed by #12
Open

Can't debug Gradle process #11

big-andy-coates opened this issue Oct 22, 2022 · 0 comments · May be fixed by #12

Comments

@big-andy-coates
Copy link

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:

* 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.

@big-andy-coates big-andy-coates changed the title Can debug Gradle process Can't debug Gradle process Oct 22, 2022
big-andy-coates added a commit to big-andy-coates/attachme that referenced this issue Oct 22, 2022
...to avoid additional output in processes picking up the `JAVA_TOOL_OPTIONS`.

Without quiet mode the process will output something like line below as its first line to stdout, which can cause problems in some situations, i.e. where the output is being consumed by another process.

```
Listening for transport dt_socket at address: 53880
```

fixes: JetBrains#11
@big-andy-coates big-andy-coates linked a pull request Oct 22, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant