This document discusses using Java and related technologies like OSGi and Eclipse Kura to develop an IoT gateway and edge analytics solution for environmental monitoring stations. It presents a use case of sensors collecting air quality data and transmitting it via MQTT to databases in the cloud for storage and complex event processing. The proposed architecture leverages Java SE Embedded, OSGi, and Oracle Event Processing Embedded to implement filtering, correlation, alerts and statistics on the gateway before transmitting data to an Everyware Cloud and Oracle Cloud for further analytics and management of devices.