spawn the JVM in a new thread. Note that there will be very little
extra overhead of launching the new thread for a new JVM since
most of the cost is involved in launching the process. Moreover,
since we are going to be using the JVM for running many tasks,
the thread launch cost becomes trivial when amortized over all
tasks. Doing it this way also keeps code simple.