The easiest start is always playing a bit around. open the console and write some simplified java code, as reported in the image below.
To execute the script right-click and choose run from the menu. The result of the script will be seen in the output window.
2) grass commands execution
Commands wrapped by
are interpreted as native grass commands and executed like that. Just use the GRASS syntax.
See below the example of the execution of the help of the g.region command.
3) the JGrass modeling language based on OpenMI
Same as for GRASS commands, JGrass commands are wrapped inside
The JGrass modeling language will need a larger article, so I don't even dare to talk about it now in this short space.
However, have a look at the shot below, showing a mixed script between GRASS, JGrass and beanshell, passing variables from one language to the other, gaining return values from the JGrass models. This all gives the possibility to easily create also complex algorythm without having to know the development framework... no compilation... just write and execute!