JVM.run with callback