Simplifying creation of JavaResource objects