A small MQTT publish and subscribe application using Eclipse-Paho Java Client
You need to configure and specify the URI of your Broker in Initiator.java, line 11. Consider HiveMQ.
$ git clone https://github.com/Nathi360/Hello-MQTT.git
$ cd Hello-MQTT-master/src/main/java
$ make clean && make
$ make run