jeval allows you to execute Java code straight from the command line (same as you would do with perl -e, bash -c) as well as run Java scripts. It does not require you to write class body with main method and all boilerplate code (but you still can do it if you want).
jeval allows you to include dependencies to any artifacts from Maven repository into the Java script files without need to create pom.xml or build.gradle for that.
For example here is a simple script yaml.java which declares dependency on snakeyaml library and uses it:
//dependency org.yaml:snakeyaml:1.21
import org.yaml.snakeyaml.*;
Yaml yaml = new Yaml();
String document = "\n- Hesperiidae\n- Papilionidae\n- Apatelodidae\n- Epiplemidae";
List list = (List) yaml.load(document);
System.out.println(list);
https://github.com/lambdaprime/jeval