解决Java报错:var cannot be resolved to a type
2022-03-01
错误
编译报错:Exception in thread “main” java.lang.Error: Unresolved compilation problem:var cannot be resolved to a type
原因
使用了低版本的JDK,var关键字是在java10中才引入的,如果使用低于java10版本的JDK,就会报错
解决
使用大于java10版本的JDK