Need to set up java in Atom

using Atom again after a long time and I’m running into some problems. Made a js file with just this:

import java.util.*;

public class test {
  public static void main (String[] args){
    int a1 = 10;
    int a2 = 20;

System.out.printIn("Enter two numbers: " + a1 + " " + a2);
int sum = a1 + a2;

System.out.printIn("The sum is: " + sum);


Im getting these errors:

C:[email protected]js:95
    throw err;

SyntaxError: D:CodingVendingMachine.js: Unexpected token (1:11)

 1 | import java.util.*;
   |            ^


and are different programming languages with about as much in common as Car and Carpet.

You have written Java but put it in a file with a file extension that marks it as JavaScript. Your IDE is trying to run it as if it were the latter and throwing errors because it is the former.

Java typically belongs in .java files.