After reading this post, you are now MagicDraw open API experts! But you still need to debug your plugins! Here is a short presentation on how to debug your MagicDraw plugin with Eclipse.

Create your MagicDraw user library

First of all you need to create a user library (Window>Preferences>Java>Build Path>User Libraries) in Eclipse containing every *.jar from the “<MagicDraw_Install_Dir>/lib” and its subfolders.

Create your debug project

Create a new Java Project, and then you need to reference your plugin project in the build path of your debug project : (Right click on the project>Configure build path)

Here I take the Eclipse project given in this post.

Then you need to create a main class which will init your plugin and launch MagicDraw :


import com.nomagic.magicdraw.core.Application;
import com.nomagic.runtime.ApplicationExitedException;

 * This class allows you to debug your MagicDraw plugin
 * @author Xavier Seignard
public class Debug {
	 * @param args
	public static void main(String[] args) {
		try {
			SimplePlugin plugin = new SimplePlugin();
			Application app = Application.getInstance();
			// Start the application (visible, not silent,
			// don't try to load a project, the given args,
			// the StartUp participant)
			app.start(true, false, false, args, null);
		} catch (ApplicationExitedException e) {

Then all you need to do is to right-click on this class and choose “Debug as” to launch MagicDraw within the Eclipse debugger and use all the functionalities it gives us!

Nota : Maybe you’ll need to tune up a bit more your debug configuration by adding “-Xmx1024m” as VM argument as shown below :

Hope this helps! See you!

Share and Enjoy:
  • Twitter
  • RSS
  • email
  • Digg
  • Reddit
  • FriendFeed
  • Google Bookmarks
  • viadeo FR
  • Technorati
  • Add to favorites
  • Print
  • PDF