Why do i get a compile error?

Hello everyone, I am new to programming the issue which I am facing is like when I run the code on codechef IDE it gives the result of “Successfully Executed” but when I try to Submit it it gives me Compilation error.

Below is my code:

import java.util.;
import java.lang.
;
import java.io.*;

class Question_A{

    public static void main(String[] args) throws IOException
    {
       try {
    	   int number;
	        Scanner sc = new Scanner(System.in);
	        
	        number = sc.nextInt();
	          while(number != 42)
	          {
	              System.out.println(number);
	              number = sc.nextInt();
	          }
	          
       }
	          catch(Exception e){
	        	  
	          } 
	       
       }
    }

Please help me