Maven project compile error: cannot find symbol (which is java.lang.String)

3573 views java intellij-idea maven

It's a very simple web scraping program that I built in intellij idea with the maven build system. It worked fine before today but when I tried to build it today it gave me object not found errors for base java objects like String and List. When I tried to reload the maven project I got another error below. Idea also highlights the basic java object in red and gives no advice. The only thing I did was slightly modify the java source code. So, I tested with the stock hello world code. It did compile and run, but Intellij still highlights String and System in red and the maven reload produces the same error. Help is greatly appreciated as I need to get some data for a research project.

Error with web scraping source code compilation error

Error:(24, 13) java: cannot find symbol
  symbol:   class List
  location: class Main

Maven reload error

Cannot resolve plugin org.apache.maven.plugins:maven-compiler-plugin:${maven.compiler.version}

This is the pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""




answered question

go to intellij menu File -> project structure -> project setting - > select your JDK

Unfortunately, that's not the problem. JDK is 11.

@T0m4t0s4uc3 Did you try adding this to ur pom ?

put your main class here

2 Answers



After resolving the maven errors, since you are facing IDE related problems, I would suggest you to do this:

  1. Go to File > Project Structure


  1. Add the JDK in Project SDK


You have forgot to define the property ${maven.compiler.version} in your POM.

Define a properties section in your POM like this:


posted this

You have to select JDK in Intellij

Go to intellij menu File -> project structure -> project setting - > select your JDK in project SDK section

posted this

Have an answer?


Please login first before posting an answer.