I'm testing a batch script, to check that it's handling any errors when a compiled jar is run.
What's the simplest snippet of a code I can add to my java to cause a runtime error?
You can simply throw a RuntimeException:
throw new RuntimeException("Test runtime exception");