{"id":20800671,"url":"https://github.com/neelkamath/gradle-debug-bug","last_synced_at":"2026-05-17T01:41:47.868Z","repository":{"id":103986816,"uuid":"263824434","full_name":"neelkamath/gradle-debug-bug","owner":"neelkamath","description":"Demo of Gradle unable to remote debug Java 9+ projects","archived":false,"fork":false,"pushed_at":"2020-05-14T05:47:19.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T12:29:21.761Z","etag":null,"topics":["bug","gradle","java9"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neelkamath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-14T05:34:18.000Z","updated_at":"2021-02-01T04:40:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"d4f2ad70-51ce-45bf-8364-7d57780efb66","html_url":"https://github.com/neelkamath/gradle-debug-bug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelkamath%2Fgradle-debug-bug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelkamath%2Fgradle-debug-bug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelkamath%2Fgradle-debug-bug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neelkamath%2Fgradle-debug-bug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neelkamath","download_url":"https://codeload.github.com/neelkamath/gradle-debug-bug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243147271,"owners_count":20243745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bug","gradle","java9"],"created_at":"2024-11-17T18:14:51.502Z","updated_at":"2026-05-17T01:41:47.799Z","avatar_url":"https://github.com/neelkamath.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gradle Debug Bug\n\nThis project demonstrates a bug in Gradle which causes it to be unable to debug Java 9+ projects.\n\nFrom the [docs](https://docs.gradle.org/current/userguide/build_environment.html):\n\n\u003e **`org.gradle.debug=(true,false)`**\n\u003e \n\u003e When set to `true`, Gradle will run the build with remote debugging enabled, listening on port 5005. Note that this is the equivalent of adding `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005` to the JVM command line and will suspend the virtual machine until a debugger is attached. Default is `false`.\n\nGradle allows for remote debugging by running `gradle --debug-jvm`. The `--debug-jvm` flag instructs Gradle to supply the JVM with `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005`. From Java 9 onwards, the argument is supposed to be `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005` ([reference](https://dev-aux.com/java/java-local-and-remote-jvm-debugging-jdk-8-and-later)). This is why remote debugging Java 9+ projects with Gradle's `--debug-jvm` doesn't work.\n\n## Installation\n\nInstall [Docker](https://hub.docker.com/search/?type=edition\u0026offering=community) so that we can easily simulate the required environments.\n\n## Usage\n\n1. We'll first run the Java 9+ project to see that the debugger doesn't work.\n    1. [Start the debugger](debug.md).\n    1. It will fail with the error `java.io.IOException: handshake failed - connection prematurally closed`.\n1. Now we'll modify the project to show that it works in Java 8.\n    1. Change line 10 of `build.gradle.kts` from `sourceCompatibility = JavaVersion.VERSION_13 ` to `sourceCompatibility = JavaVersion.VERSION_1_8`  \n    1. Change line 4 of `docker-compose.yml` from `image: gradle:6.4.0-jdk14` to `image: gradle:6.4.0-jdk8`.\n    1. [Start the debugger](debug.md).\n    1. The debugging session starts successfully.\n    \n## License\n\nThis project is under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneelkamath%2Fgradle-debug-bug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneelkamath%2Fgradle-debug-bug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneelkamath%2Fgradle-debug-bug/lists"}