Adding a java layer to yocto image

See if this helps

Or you can see this on using java in legato application