Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Compiling Java Paho clients standalone

Hi,
 
You'll need to include the Paho Client Jar in your classpath when you compile. Something like this:
 
 
javac -cp ".:/home/james/paho/org.eclipse.paho.client.mqttv3-1.0.3-SNAPSHOT.jar:" -g MqttPublishSample.java
 
Keep in mind that if you're on windows the separators in the classpath are ; whereas in unix operating systems, the separators are :
 
Kind regards,
 
James Sutton
Software Engineer - IoT Foundation - MQTT Open Source Projects
Technical Trojan - Wimbledon Project

Phone: 01962 815438 | Extension: x372454
E-mail: 
Personal Website: www.jsutton.co.uk
Find me on:      
IBM

Hursley Park
HursleySO212JN
United Kingdom
 
IBM United Kingdom Limited Registered in England and Wales with number 741598 Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU
 
 
----- Original message -----
From: Ananth Bala <idcananth@xxxxxxxxx>
Sent by: paho-dev-bounces@xxxxxxxxxxx
To: General development discussions for paho project <paho-dev@xxxxxxxxxxx>
Cc:
Subject: [paho-dev] Compiling Java Paho clients standalone
Date: Wed, Oct 14, 2015 12:50 AM
 
Hi,
   I want to use Paho Java client. So, I built the code from the source using  'mvn package -DskipTests' as outlined in:  https://eclipse.org/paho/clients/java/ and it was successful. However I have the following problem:
I wanted to compile the sample client java code "MqttClientPaho.java"  available in the directory:  "/org.eclipse.paho.mqtt.java/org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/client"  using the command "javac -g MqttClientPaho.java". It gives me a lot of errors. A snapshot of the error is:

MqttClientPaho.java:17: error: cannot find symbol
import org.eclipse.paho.client.mqttv3.MqttClient;
                                     ^
  symbol:   class MqttClient
  location: package org.eclipse.paho.client.mqttv3
MqttClientPaho.java:18: error: cannot find symbol
import org.eclipse.paho.client.mqttv3.MqttClientPersistence;
                                     ^
  symbol:   class MqttClientPersistence
  location: package org.eclipse.paho.client.mqttv3
MqttClientPaho.java:19: error: cannot find symbol
import org.eclipse.paho.client.mqttv3.MqttException;
                                     ^
  symbol:   class MqttException
  location: package org.eclipse.paho.client.mqttv3
MqttClientPaho.java:25: error: cannot find symbol
public class MqttClientPaho extends MqttClient {
                                    ^
                                       ^
 
Can you please provide some pointers as to how I can compile java programs stand alone which uses the Eclipse Client Java libraries.
 
Thank you,

 
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev
 


Back to the top