Scanner not working

I wrote this code:

import java.util.Scanner;

public class Even_Odd {

public static void main(String[] args) {
	Scanner scn = new Scanner(System.in);
	int n = scn.nextInt();
	System.out.println(n);
	

}

}

And it is showing me an error on Mac OS 12.3 at the Scanner scan part and thus, I can’t run the code.

Please suggest the solution.