Remotely Debugging an Eclipse Plugin

This tutorial will show you how to debug an Eclipse plugin remotely for bug resolution after it has been installed in the IDE.

Introduction
The Eclipse plugin can be debugged from inside the IDE while in the development phase, but once the plugin is installed in the IDE, we need to debug it remotely for bug resolution. In this quick tutorial, I’m going to explain how to debug an Eclipse plugin remotely.

Plugin Project
Let’s suppose we have developed our simple Hello World plugin and installed it in our IDE. Now, to debug the plugin remotely, please follow the steps below.

Step 1
Open the first instance of Eclipse IDE pointing to the workspace where your Hello World plugin project is located.

Step 2
Navigate to the eclipse.ini file of your IDE. Here is a screenshot of the location of the file in MacOS.

Image title

Now add the following JVM arguments to the file:

-vmargs
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044
Step 3
Now, open another instance of the Eclipse IDE (on MacOS, use the command open -a -n Eclipse in the terminal).This instance will point to a workspace different from the one which contains the Hello World plugin project.

Step 4
Now, in the workspace containing the Hello World plugin project, make the following remote debug configurations/; Navigate Run -> Debug Configurations -> Remote Java Application.

Image title

Then hit the debug button. Also, do not forget to put break-points in the codes of the Hello World plugin to be debugged.

Step 5
In the other workspace (which does not contain the Hello World plugin) try to use the Hello World plugin and it will be remotely debugged in the other instance of Eclipse.

Conclusion
In this brief tutorial, I have shown how to debug an Eclipse plugin remotely.

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注