Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » Trouble compiling Paho java plugin
Trouble compiling Paho java plugin [message #1109523] Sun, 15 September 2013 11:01 Go to next message
Jim Veneskey is currently offline Jim Veneskey
Messages: 2
Registered: September 2013
Junior Member
Hi,
I have successfully setup a simple Mosquitto MQTT server, and now I am attempting to setup Paho so I can experiment with it - and hopefully learn to use MQTT.

I have followed the quick start guide here:
listed here:

http://wiki.eclipse.org/Paho
Specifically - 'A quick start guide to the Paho MQTT Java client'

As mentioned above, I did not have any problems installing the Mosquitto server, it's this section that has me stumped:

Building the plugin


Build Java client library

Download the latest sources from Paho repository:

lynx@wonderland$ git clone http://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.java.git
After you will get directory org.eclipse.paho.mqtt.java with two subdirectories:

org.eclipse.paho.client.mqttv3 - client library
org.eclipse.paho.sample.mqttv3app - sample application
To build client library you can use ant:

lynx@wonderland$ cd org.eclipse.paho.client.mqttv3
lynx@wonderland$ ant


Sounds simple enough - but on my Mac - I am seeing this:

'errors'

BigMac:org.eclipse.paho.client.mqttv3 biff$ ant
Buildfile: /Users/biff/MQTT/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

clean:
[echo] Cleaning project...

init:
[mkdir] Created dir: /Users/biff/MQTT/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build/src
[mkdir] Created dir: /Users/biff/MQTT/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build/bin

compile:
[echo] Compiling client library...
[copy] Copying 113 files to /Users/biff/MQTT/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build/src

BUILD FAILED
/Users/biff/MQTT/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build.xml:55: Replace: source file /Users/biff/MQTT/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build/src/org/eclipse/paho/client/mqttv3/internal/ClientComms.java doesn't exist

Total time: 0 seconds



A little googling around suggested that I didn't have the require ant contrib package, and being a bit leery of mucking up my Java install under OSX - I turned to a handy Ubuntu notebook and tried running ant over there.

Same issue - so I found instructions on how to install ant-contrib under Ubuntu - and gave that a try.

'ubuntu with ant-contrib errors'

biff@MQTT:~/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3$ ant
Buildfile: /home/biff/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build.xml

clean:
[echo] Cleaning project...
[delete] Deleting directory /home/biff/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build

init:
[mkdir] Created dir: /home/biff/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build/src
[mkdir] Created dir: /home/biff/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build/bin

compile:
[echo] Compiling client library...
[copy] Copying 113 files to /home/biff/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build/src

BUILD FAILED
/home/biff/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build.xml:55: Replace: source file /home/biff/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3/build/src/org/eclipse/paho/client/mqttv3/internal/ClientComms.java doesn't exist

Total time: 1 second




So - it looks like I got slightly farther, but I'm still stuck.

I'd appreciate any suggestions on how to make some progress via either OSX or Ubuntu.

thanks!

Jim
Re: Trouble compiling Paho java plugin [message #1111010 is a reply to message #1109523] Tue, 17 September 2013 12:41 Go to previous messageGo to next message
Andy Piper is currently offline Andy Piper
Messages: 15
Registered: November 2011
Location: Kingston upon Thames, UK
Junior Member

Hi Jim, sorry you are encountering issues Sad

It looks like we need to update our start guides.

One of the things we have been working on lately is improving and automating our builds. As a result, there are two approaches you could take:

- grab the nightly build binary Jar, which is in the Eclipse Maven repository (this is equivalent to building for yourself)
https://repo.eclipse.org/content/repositories/paho/org/eclipse/paho/ is the top level
drilling down... the latest build is
https://repo.eclipse.org/content/repositories/paho/org/eclipse/paho/mqtt-client/0.4.1-SNAPSHOT/mqtt-client-0.4.1-20130903.161245-4.jar

- alternatively, run a build using Maven (mvn clean install) rather than ant.

Slightly frustratingly, you may then potentially hit an issue with the sample - it *should* work as described but I haven't had a chance to test it today.

I'm going to raise an issue in our Bugzilla to get those links and guides updated.

For more help, you might find the paho-dev mailing list gets a little more traffic than the web forum.


Cloud Foundry Developer Advocate @ Pivotal | Eclipse Paho project co-lead | mqtt.org | andypiper.co.uk
Re: Trouble compiling Paho java plugin [message #1128252 is a reply to message #1111010] Mon, 07 October 2013 09:59 Go to previous message
Jim Veneskey is currently offline Jim Veneskey
Messages: 2
Registered: September 2013
Junior Member
Hi,
I am still trying to get Eclipse Paho setup and running.
As per your suggestion - I am now trying the pre-compiled Plug-in route.

I followed along via the:

"A quick start guide to the Eclipse Paho Plug-in"


Here are the steps I have taken and their results:


#1 - Downloaded and installed Eclipse

#2 - Downloaded MQTT Application Framework via:

git clone git://git.eclipse.org/gitroot/paho/org.eclipse.paho.esf.git


#3 - Followed this step - pointed to the just download Framework

Building (Paragraph 1)

Run Eclipse.
Open "File" -> "Import ..." -> "General" -> "Existing Projects into Workspace".
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.



This results in 2 errors:

Description Resource Path Location Type
Project 'org.eclipse.paho.client.eclipse.view' is missing required Java project: 'org.eclipse.paho.client.mqttv3' org.eclipse.paho.client.eclipse.view Build path Build Path Problem


and

Description Resource Path Location Type
The project cannot be built until build path errors are resolved org.eclipse.paho.client.eclipse.view Unknown Java Problem


I expected that due this:

Building


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.


#4 - Downloaded the pre-built JAR file as you suggested:

At this date, it was this file:

mqtt-client-0.4.1-20130924.110047-6.jar


#5 - Followed this step (using the actual name of the JAR file of course):

Building (Paragraph 2)

In Eclipse open "Package Explorer" view.
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.


Same two errors are still present

#6 This next step is where I am stuck:

Building (Paragraph 3)

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

In "Package Explorer" view under org.eclipse.paho.client.eclipse.view project find plugin.xml and open it.
Open "Runtime" tab and remove "org.eclipse.paho.client.eclipse.view" from "Classpath".



I found the plugin.xml file easily enough and opened it via Eclipse.
Not sure if I opened it correctly, I just right clicked on it - and selected "Open"
It then displays a hierarchy view:

extension -> point

category -> id
category -> name

view -> id
view -> name
view -> category
view -> class
view -> icon


I am NOT seeing a "Runtime" tab anywhere - so I can't perform the modification to Classpath...


So - that is where I'm now stuck.

Suggestions?

Thanks!


Jim

(I will also try subscribing to the mailing list - and sending this query there)
Previous Topic:Publish and persistence issue
Next Topic:Lua Client - attempt to index field 'client' (a nil value)
Goto Forum:
  


Current Time: Tue Jul 22 21:50:32 EDT 2014

Powered by FUDForum. Page generated in 0.01459 seconds