Need to set up java in Atom Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Need to set up java in Atom without wasting too much if your time.

The question is published on by Tutorial Guruji team.

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:UsersReg.atompackagesscriptnode_modules@babelcorelibparserindex.js:95
    throw err;
    ^

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

 1 | import java.util.*;
   |            ^

Answer

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.

We are here to answer your question about Need to set up java in Atom - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji