All Groovy features you can use in java module. To use it you have to configure groovy facet
If you configure it right, in module context menu, in submenu New "Groovy Class" and "Groovy script" will appear