title: Empty statement after while '(' Expected Error
body: <p>For the program I am writing I have to generate prime numbers between 2 and a number over 50 that the user enters what I am trying to do is execute a loop that will start at 2 and go up to what the user entered then Inside i made a loop that loops between 2 and the current number that is needed to be prime and if at any point it divides equally it sets a boolean to false to later be printed wether the number is prime or not but i have not yet put where the number will be printed yet because i am stuck on an error that is telling me <strong>Empty statement after while '(' Expected Error</strong> if it helps i am using net beans</p>
  
  <pre><code>    package assignment_4_1;
  import java.util.Scanner;
  public class Assignment_4_1 {
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
  
          Scanner input = new Scanner (System.in);
          System.out.println("Enter a number above 50 to find all of the primes between 1 and that number: ");
          int firstNum = input.nextInt();
          int primecalc = 1;
          int index = 2; 
          boolean secondloop;
          secondloop = true;
  
          while(primecalc &lt;= firstNum)
          {
          while (index &gt;= primecalc;)  //the error is on this line
              {
                  if(index%primecalc == 0)
                  {
                      secondloop = false;
                  }
                  index++;
              }
          primecalc++;
  
          }
  
      }
  
  }
  </code></pre>