title: Exception cannot be converted to Throwable
body: <p>I'm working on macOS with JDK8.</p>
  
  <p>In catch, I have to give the entire name of exception like
  in this case (ArithmeticException e) instead of (Exception e)
  to run the code.</p>
  
  <p>If I use (Exception e) it gives an error that I'm not getting on windows os.</p>
  
  <p>why is that??
  and how should I solve this??</p>
  
  <p>The code works perfectly on windows OS with JDK8.
  On macOS work perfectly if the proper name of the exception (ArithmeticException e) is given.</p>
  
  <pre><code>import java.util.*;
  public class ExceptionDemo
  {
  public static void main(String args[])
  {
     int a,b,c;
     Scanner sc=new Scanner(System.in);
     System.out.println("enter first number:");
     a=sc.nextInt();
     System.out.println("enter second number:");
     b=sc.nextInt();
     try
     {
         c=a/b;
         System.out.println("Result is:"+c);
     }
     catch(Exception e)
     {
         System.out.println("second number cannot be zero/0 "+e);
     }
  
     System.out.println("still running");
     }
     }
  </code></pre>
  
  <p>This is the error I'm getting as below: </p>
  
  <blockquote>
    <p>incompatible types: Exception cannot be converted to Throwable
      catch(Exception e)</p>
  </blockquote>