Compiling a BeanShell script into a class?

For my game, I’m using BeanShell to allow my users to script the game objects (i.e. the player, enemies, blocks etc.). BeanShell scripts are interpreted, which will cause some slowdown when there are tons of objects. It was mentioned that BeanShell scripts could be compiled into Java classes but the guide on the BeanShell site never said how.

I can guess that you wouldn’t use the standard compiler which would choke on the scripting language leniencies. Does anyone know how this is this done?