How to run a Java program multiple times without JVM exiting?
问题 Suppose I have a Java program Test.class , if I used the below script for i in 1..10 do java Test done the JVM would exit each time java Test is invoked. What I want is running java Test multiple times without exiting the JVM, so that, the optimized methods in prior runs can be used by later runs, and possibly be further optimized. 回答1: public class RunTest { public static void main(String[] args) { for(int i=1; i<=10; i++) Test.main(args); } } This should do it. You can call the Test class'