Thanks for reaching out.
Are you using the latest image version? If you aren't, you can download it from here: https://software.intel.com/en-us/iot/hardware/edison/downloads, this image already includes openjdk 8, and just checked it and I ran a simple code without issues, check the next photo:
I hope you find this helpful.
Have a nice day.
I can find the image in the above location. But I am not able to find the steps for updating the image. If you have any steps to do it, Please share as it will be useful.