When I run java program, I often find myself specifying many JVM flags on the command line. As the number of those flags
increases, listing all of them directly on the command line starts to become unwieldy. Therefore, I wonder if I can put
those flags in a file, multiple line preferably. The most obvious choice is to use a shell script as the launcher. It
works fine, but this also means that each java file is accompanied by a corresponding shell script…
In order to relieve myself of maintaining such java-shell relation for all java files, I set out to find a way to
embed JVM flags directly in my java program. The following shows how this approach looks like.