Search code examples
intellij-ideaimportapache-commons

IntelliJ: cannot resolve smybol in "org.apache.commons.lang3.tuple.ImmutablePair"


I am working on a web visualisation for a given project (db with genes, proteins, task is to do some nice visualisation with springboot and thymeleaf). The project was provided with all files, yet I am missing some libraries (also leading to some errors in the code ofc).

When trying to import:

import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;

lang3 gives me a "cannot resolve symbol" error and automatically searching jars on web results in "no jars found".I found the lang3-jar manually and successfully added it to the project library. When importing:

import org.apache.commons.lang3.*; 

All errors for tuple.Pair-usage are gone. Yet, usage of ImmutablePair still results in a "cannot resolve symbol" error.

Firstly, I am confused and now unsure, if my knowledge of imports is correct. I learned, if for example you import something.anything.x and something.anything.y, you could also just import something.anything.*; and x and y would be covered.

Secondly, if needed, where do I find the jars I need (I could not find them yet).

Thanks :)


Solution

  • So, I do not know, where this error results in, yet I do know a solution. When adding the library, select "From Maven" and search for Apache lang3 and add it. Resolves the problems.