Trouble compiling Paho java plugin [message #1109523] |
Sun, 15 September 2013 11:01  |
Eclipse User |
|
|
|
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 #1128252 is a reply to message #1111010] |
Mon, 07 October 2013 09:59  |
Eclipse User |
|
|
|
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)
|
|
|
Powered by
FUDForum. Page generated in 0.08104 seconds