I\'ve tried both the example in Oracle\'s Java Tutorials. They both compile fine, but at run-time, both come up with this error:
Exception in thread \"main\"
It happens a lot with my genymotion devices. Make sure you have a good amount of memory available on your drive where Genymotion is installed.