The easiest way, and the one I always use, is to define an object (like you), but not the corresponding companion class. In this case, the Scala compiler will create a couple of classes, one whose name is exactly the same as the object, will contain static transfer methods, which for the purpose of entry points into the launcher is exactly what you need. Another class has the name of your object with $ added and where the code is located. Javap will reveal these things if you are interested in learning more.
Thus, your HelloWorld example will work the way you want, which allows you to:
% scala pkg.package.more.HelloWorld args that you will ignore
Randall Schulz
Randall schulz
source share