Start Websphere Liberty in Debug mode and connect via Eclipse

user3395335 picture user3395335 · Mar 8, 2014 · Viewed 10k times · Source

I am searching for a way to start the Websphere Liberty profile in debug mode from the command line? I want to be able to start Liberty, so that it is listening for debug connections on a specific port. Then I would like to connect to Liberty from Eclipse, so that I can step through and debug the server code running in Liberty.

I've tried integrating Liberty into Eclipse and using the Eclipse 'Servers' view. This works great and I can start and stop Liberty using debug mode. Unfortunately, this method does not satisfy my use case because the build process uses tools external to Eclipse.

Essentially, I need a way to do this via the command line.

I tried creating a jvm.options file for Liberty and starting it, but I still can't connect to the port I specified. I'm sure I'm doing something wrong, but thus far I haven't figured it out.

This page has some info on jvm.options

Answer

McDowell picture McDowell · Mar 8, 2014

The Administering the Liberty profile from the command prompt page describes how to do this:

[bin]$ export WLP_DEBUG_ADDRESS=7778
[bin]$ ./server debug
Listening for transport dt_socket at address: 7778

You can then connect from Eclipse using Remote Debugging.