You can't expose Java classes from Alfresco Rhino JavaScript integration - we have purposely disabled this feature - it is a huge potential security hole! Any user can execute a script, and then could then execute Java on the server - which could potentially do anything…! :shock: So it has been disabled.
The correct way to call Java from JavaScript is to create a Repository action class and then call that using the 'actions' object from JavaScript. Since only a server admin can add new JARs to the repo this is a safe route.
Thanks,
Kevin