why don't you just right click on the
main() method and choose
"debug as... java application"?
please see http://java.dzone.com/articles/how-debug-remote-java-applicat to enable the remote debugging. if you are using tomcat to run your application, start tomcat with remote debug parameters or you can start tomcat with jpda support by using following command.
<tomcat bin dir>/startup.bat jpda
<tomcat bin dir>/startup.sh jpda
this will enable remote debugging on port 8000
with eclipse or any other ide, just right click on your main spring boot application and click "debug as java application"
this question is already answered, but i also got same issue to debug springboot + gradle + jhipster,
mostly spring boot application can debug by right click and debug, but when you use gradle, having some additional environment parameter setup then it is not possible to debug directly.
to resolve this, eclipse provided one additional features as remote java application
by using this features you can debug your application.
follow below step:
run your gradle application with
./gradlew bootrun --debug-jvm command
now go to eclipse --> right click project and debug configuration --> remote java application.
add you host and port as localhost and port as 5005 (default for gradle debug, you can change it)
refer for more detail and step.
right click on the spring boot project -> debug as -> spring boot app. put a debugger point and invoke the app from a client like postman
the best solution in my opinion is add a plugin in the pom.xml, and you don't need to do anything else all the time:
run below command where
pom.xml is placed:
mvn spring-boot:run -drun.jvmarguments="-xdebug -xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
and start your remote java application with debugging option on port
i didn't need to set up remote debugging in order to get this working, i used maven.
- ensure you have the maven plugin installed into eclipse.
- click run > run configurations > maven build > new launch configuration:
- base directory: browse to the root of your project
- click apply then click run.
nb. if your ide has problems finding your project's source code when doing line-by-line debugging, take a look at this so answer to find out how to manually attach your source code to the debug application.
hope this helps someone!
how to debug a remote staging or production spring boot application
let's assume you have successfully followed spring boot's guide on setting up your spring boot application as a service.
your application artifact resides in
/srv/my-app/my-app.war, accompanied by a configuration file
# this is file my-app.conf
# what can you do in this .conf file? the my-app.war is prepended with a sysv init.d script
# (yes, take a look into the war file with a text editor). as my-app.war is symlinked in the init.d directory, that init.d script
# gets executed. one of its step is actually `source`ing this .conf file. therefore we can do anything in this .conf file that
# we can also do in a regular shell script.
when you restart your spring boot application with
sudo service my-app restart, then in its log file located at
/var/log/my-app.log should be a line saying
listening for transport dt_socket at address: 8002.
client-side (developer machine)
open an ssh port-forwarding tunnel to the server:
ssh -l 8002:localhost:8002 firstname.lastname@example.org. keep this ssh session running.
in eclipse, from the toolbar, select run -> debug configurations -> select remote java application -> click the new button -> select as connection type standard (socket attach), as host localhost, and as port 8002 (or whatever you have configured in the steps before). click apply and then debug.
the eclipse debugger should now connect to the remote server. switching to the debug perspective should show the connected jvm and its threads. breakpoints should fire as soon as they are remotely triggered.
instead of typing
you will still need to attach the debugger in eclipse by making a new debug configuration for a "remote java application" on the relevant port.
there's section 19.2 in spring boot reference that tells you about starting your application with remote debugging support enabled.
$ java -xdebug -xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n \
after you start your application just add that remote java application configuration in run/debug configurations, select the port/address you defined when starting your app, and then you are free to debug.
- How to debug Spring Boot application with Eclipse?
- how to debug spring application with gradle
- How to run Spring Boot web application in Eclipse itself?
- How to solve "Secure storage was unable to save the master password" in Eclipse CDT remote application with SSH password debug connection?
- How do I create a Spring Boot Starter Project in Eclipse that is properly configured with a Run Configuration?
- How to run and debug C++ application in Eclipse that's started with a script?
- How to debug remote deployed spring boot app & maven on eclipse
- Java Spring boot application with OpenCv : UnsatisfiedLinkError under Eclipse if use spring-boot-devtools
- How to remote debug two spring boot applications running in the same container with the same codebase but with different profiles?
- Whitelabel Error Page : Spring Boot Application with Eclipse
- how to debug application as root in eclipse in Ubuntu?
- Exporting Spring Boot application as JAR file in eclipse
- How to run spring boot application both as a web application as well as a command line application?
- Running Spring Boot application through Eclipse picks up test classes
- How to run spring boot app in Eclipse tomcat?
- How does Eclipse debug code in an application server?
- how to debug java web application in eclips with weblogic server
- How to debug CUDA using eclipse Nsight with only one GPU
- On Linux, Debugging a C++ application with gdb in Eclipse CDT, how to input something to stdin?
- How to configure jboss application server with eclipse IDE
- How to add an Icon to an application built with Eclipse Galileo C and MinGW?
- How do I debug a remote application in my eclipse
- How do I debug Android native lib in eclipse with ARM DS-5 without going crazy?
- How to debug Groovy code via the remote Java application debugging in Eclipse
- Spring boot how to make project run on server in eclipse
- How to debug PHP application using Eclipse PDT (xdebug and zend debugger)
- How to open Spring Boot sample in Eclipse STS
- SpringBoot: How to provide VM Argument in Spring Boot App, while running from Eclipse
- How Can I Change The Location of Image Files Created by BIRT in a Spring Boot Application
- Spring Boot application suddenly stops after outputing logo and version on Eclipse
More Query from same tag
- How do I get support for GPB in Eclipse?
- how to install android ADT plugin in eclipse
- Getting exception while starting Tomcat server 9.0
- Eclipse does not recognize my changes in src folder, throws the same error
- EGIT rejected non-fast forward
- Why "Designtime Attributes" doesn't work?
- JavaFx Css not working with eclipse
- JSON parsing with Eclipse
- Provisioning exception in eclipse ADT
- Slot Machine - Output not correct
- Adapter & ListView
- Android: How to change lots of string names in strings.xml easily?
- Eclipse breaking on ClassLoader with java 8 when debugging
- Run as Android Application
- Eclipse plugin: attach a java process to a code launch
- How to refresh a view when it opens in RCP?
- Giving error that the bind value at index 4 is null
- Eclipse/GGTS crash with Java 7 on Mac OS X?
- Android, Renderscript, ScriptIntrinsicBlur, import libRSSuport.so and librsjni.so
- why sourceTree push automatically files that have local changes?
- Error when parsing XML file in Java
- Java VM crashes under Mac OS X on Spring persistence layer startup
- add a specific jar from maven repository
- Using SQLite in Eclipse
- Provide library from Eclipse plugin to workspace
- How to configure eclipse to autosave on run?
- Target unkown after Android 4.3 update
- How to add external google_play_service library in my project? (other than own sdk's)
- Can't install e(fx)clipse
- Scala/ Eclipse - Files not compiling