Display all PRIME number up to user's input limit. Java : So I've been asked to define an algorithm to display all prime numbers up to a limit set up by the user.  I chose to use nested **while** loops but for some reason the program remains suck after printing the first prime number...
I've did this exercise on the paper line by line and can't figure out where is the problem. I appreciate any suggestion.  

This is my code:

    System.out.println("Display all prime numbers from 3 up to...");
    int limit = sc.nextInt();
    int iterator = 3, iterator2 = 2;
    boolean isPrime = true;

    while (limit >= iterator) {
      while (iterator > iterator2) {
        if (iterator % iterator2 != 0) {
          iterator2++;
        } else {
          isPrime = false;
        }
      }
      iterator2 = 2;
      if (isPrime == true) {
        System.out.print(iterator + ", ");
        }
      iterator++;
    }