Quick start guide for the Eclipse Paho Plug-in

Posted on Aug 28, 2012

I have received the letter from Andy where he mentions that there is Eclipse plug-in for testing Paho client code. I checked the repository and found it. I think it is pretty useful especially for debugging some simple MQTT client commands to a broker. Here I would like to describe how to build it.

Prerequisites

Paho plug-in depends on the client library org.eclipse.paho.client.mqttv3.jar. Instructions how to build it can be found here.

Getting sources

Get sources of MQTT Application Framework:

lynx@wonderland$ git clone git://git.eclipse.org/gitroot/paho/org.eclipse.paho.esf.git

After it finishes a new directory named org.eclipse.paho.esf will appear.

Plug-in files resides in org.eclipse.paho.esf/org.eclipse.paho.client.eclipse.view directory.

In README.txt there is a short description of plug-in itself and how to install and build it. Unfortunately due to luck of update_site/update.site.zip it can't be installed at once and needs to be build manually.

Building

Build instructions in README.txt does not cover all steps. Here is the more detailed description which covers Eclipse 3.8 and Eclipse Juno (but I believe it should work for other versions as well).

  1. Run Eclipse.
  2. Open "File" -> "Import ..." -> "General" -> "Existing Projects into Workspace".
  3. Select "Select root directory" and specify path to org.eclipse.paho.esf/org.eclipse.paho.client.eclipse.view directory. In "Projects" choose org.eclipse.paho.client.eclipse.view.

When import finishes there will be compilation errors that's because plug-in depends on org.eclipse.paho.client.mqttv3 library. To fix them this library needs to be imported into plug-in project root directory and added to the classpath.

  1. In Eclipse open "Package Explorer" view.
  2. Right click on org.eclipse.paho.client.eclipse.view project, then choose "Import" -> "General" -> "File System" and provide path to the org.eclipse.paho.client.mqttv3.jar.

Classpath should be changed through "Plug-in Manifest Editor" view.

  1. In "Package Explorer" view under org.eclipse.paho.client.eclipse.view project find plugin.xml and open it.
  2. Open "Runtime" tab and remove "org.eclipse.paho.client.eclipse.view" from "Classpath".
  3. Add org.eclipse.paho.client.mqttv3.jar. Classpath should look as follows:
  4. org.eclipse.paho.client.mqttv3.jar
    .
    

Additional steps needs to be taken:

  1. Open "Dependencies" tab and remove org.eclipse.paho.client.mqttv3 from all dependencies. On Eclipse Juno also remove org.eclipse.core.boot.
  2. In "Overview" tab find "Update the classpath settings" and press it. Once it' s done your "JRE System Library" used for building will be the same as plug-in required execution environment.

For Eclipse Juno few more steps needs to be done:

  1. Open "Extensions tab".
  2. Right click on "org.eclipse.ui.views" -> "New" -> "category".
  3. Type "Other" as the name of the category and save its id.
  4. Choose "Eclipse Paho Client View" and find the newly added category in the category field by providing its id.

Now Paho plug-in can be started by pressing "Launch an Eclipse application" from the "Plug-in Manifest Editor" view. After Eclipse will be started Paho view can be opened from "Window" -> "Show view" - > "Other ..." -> "Other" -> "Eclipse Paho Client View".

If plug-in is not there please refer to Eclipse wiki.

If plug-in runs and works correctly it can be exported in a jar file as ordinary plug-in, and further deployed into Eclipse:

  1. In "Plug-in Manifest Editor" view of plugin.xml press "Export deployable plug-ins and fragments".
  2. Select org.eclipse.paho.client.eclipse.view.
  3. In "Destination" tab choose "Directory" and provide a path where plug-in will be exported.

Installation

In latest versions of Eclipse to install plug-in it is enough to place it under "dropins" directory of Eclipse installation directory.

  1. Close Eclipse.
  2. Copy org.eclipse.paho.client.eclipse.view.jar into <Eclipse root>/dropins.
  3. Run Eclipse.

After Eclipse will be started Paho view can be opened from "Window" -> "Show view" - > "Other ..." -> "Other" -> "Eclipse Paho Client View".

If plug-in is not there please refer to Eclipse wiki.

<<<