I get that message when evaluating my code on codeGym, but I can't seem to find it in my IDE. It gives me the correct result. But maybe there is a test case I'm unaware of?
package com.codegym.task.task14.task1420;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
GCD
Greatest common divisor (GCD).
Enter 2 positive integers from the keyboard.
Display the greatest common divisor.
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(
new InputStreamReader(System.in)
);
int n1 = Integer.parseInt(reader.readLine());
int n2 = Integer.parseInt(reader.readLine());
n1 = Math.abs(n1);
n2 = Math.abs(n2);
if (n1 < 0 || n2 < 0) throw new NumberFormatException();
while (n1 != n2) {
if (n1 > n2) n1 = n1 - n2; else n2 = n2 - n1;
}
System.out.println(n2);
}
}