Fix Scala compile issue by using a scala <-> java proxy class

A better fix than #471