[JAVA] Remote debugging with Gradle test

problem

When I run the junit test class from Eclipse and get the following error, I usually say what the classpath is when I google.

Error: Main class org.eclipse.jdt.internal.junit.runner.Could not find and load RemoteTestRunner
Cause: java.lang.ClassNotFountException: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner

I tried various solutions, but it didn't work at all (it seems stupid to spend time at work), so I wondered if I could do remote debugging with the Gradle test.

Remote debugging

If you execute it with the "--debug-jvm" option, it will stand by on port 5005, so you can connect by remote debugging from Eclipse.

$ ./gradlew test --tests "*XxxxTest" --info --debug-jvm

Summary

I thought it was impossible until now, but Gradle also had an option to enable remote debugging.

Recommended Posts

Remote debugging with Gradle test
Integration Test with Gradle
Remote debugging with intellij
JUnit 5 gradle test fails with lombok annotation
Java automated test implementation with JUnit 5 + Gradle
Build and test Java + Gradle applications with Wercker
Use ProGuard with Gradle
Install Gradle with ubuntu16.04
DataNucleus starting with Gradle
[Rails] Test with RSpec
Test Nokogiri with Rspec.
Automatically test with Gauge
Load test with JMeter
Unit test with Junit.
Use WebJars with Gradle
Get started with Gradle
Use jlink with gradle
Java multi-project creation with Gradle
Test Active Strage with RSpec
Lombok not working with Gradle5
Test GraphQL resolver with rspec
Use log4j2 with YAML + Gradle
Hello World with SpringBoot / Gradle
REST API test with REST Assured Part 2
I can't install lombok with Gradle.
[Java] Test private methods with JUnit
Copy and paste test with RSpec
Test list inclusion relationships with AssertJ
Swift beginner Debugging memo with Xcode
Test Spring framework controller with Junit
Develop Processing with IntelliJ + Kotlin + Gradle
Remote debugging of the Cognos SDK
Let's unit test with [rails] Rspec!
Spring Boot gradle build with Docker
Try remote debugging of Java with Remote Containers in Visual Studio Code Insiders