title: I'm trying to find the sum of primes below 2 million in Java
body: <p>I'm trying to find the sum of primes below millions. My code works when I try to find the sum of primes below hundred thousands but when I go large numbers it doesn't work. So I need some help to get this work for big numbers...</p>
  
  <pre><code>import java.util.Scanner;
  public class sumPrime {
  
    public static void main (String args []){
  
      long n = 2000000; int i; int j;int sum =0;
      for (i=2; i &lt;n; i++){
          for (j=2; j&lt;i; j++){
              if (i%j==0){
                  break;
              }
          }
          if (i==j){
              sum +=i;
          }
      }
      System.out.print(sum);
    }
  }
  </code></pre>