New function to do a Java class to access a Scala class.