CodeChef Java Compiler generating error on "var" keyword

Main.java:43: error: cannot find symbol
for (var i : graph.get(node - 1)) {
^
symbol: class var
location: class PATHSUMS
1 error

I’m getting this error, is there any fix?
Code is working correctly in my IDE.
Question link:https://www.codechef.com/COOK123B/problems/PATHSUMS