You can follow this tutorial: http://wiki.ros.org/rosjava/Tutorials/indigo/RosJava%20Message%20Artifacts from genjava. Note that you need to have mavros messages installed.