please see the line 1,
import java.util.InputMismatchException;
import java.util.Scanner;
class AA
{
public static void main(
String g[])
{
boolean notInt = true;
int meters=-1;
Scanner keyboard=new Scanner (System.in);
while(notInt)
{
try
{
//reads the amount of meters the user typed
meters = keyboard.nextInt();
notInt= false;
}
catch(InputMismatchException e)
{
meters = 0;
System.out.println("opps, you did not enter a valid option.");
notInt= false; // line 1
}
}
}
}