[quote]ok but I want to prevent user from using java and only allow the use of my custom language exclusively.
I already had a look at beanshell and janino but AFAIK they are compiling java, which I do not want to do.
[/quote]
beanshell has nothing to do with “compiling java” so I’m not sure what you’re saying here.
It is quite easy to “prevent” your users from using java from within beanshell: you could try searching the mailing list archives, or asking on the list for help in doing this.
IIRC unless you explicitly “allow full access to everything everywhere” then people writing beanshell scripts only have access to things you make available to them AND the default things that get imported into java (java.lang.). You might be able to disable access to java.lang. using a security manager or some beanshell-specific feature. I know that a lot of people are interested in doing this with beanshell; I don’t know how easy/successful it is.
However…WHY do you want to police access to java? You do realise that you will never prevent people from wiritng malicious code, e.g.:
while( true )
;
…so you need to put in introspection and stuff anyway, and once you’re doing that why not just introspect for any java stuff you want to prevent access to?
Also, there’s a lot of stuff you can disable in java by altering the security manager / security policy.