Terminate Java Virtual Machine (JVM) - Java Java Virtual Machine

Java examples for Java Virtual Machine:Utility

Description

Terminate Java Virtual Machine (JVM)

Demo Code

public class Main {
       //from   ww  w.  ja va 2 s  .c o m
        public static void main(String args[])
        {
           Runtime runtime = Runtime.getRuntime();
           System.out.println("About to halt the current jvm");
           runtime.halt(1);
        }
       
}

Result


Related Tutorials