I am working on something in my Java 8 project and now I need to use a model-class from another jar that is done in Java 11 (but not using modules). I declare the Maven dependency in my pom.xml and see the jar file in my project in IntelliJ. When I try to use the class from the jar IntelliJ tells me it doesn't know it as it's not imported yet, but it knows the path where it is so I can just import it.
But when I import it even with the fully qualified it says "Cannot resolve symbol ".
I already tried to invalidate Cache+Restart or delete the Target folder and clean-install again but nothing helps. IntelliJ just can not find the class.
When I check the classpath of my project the jar-project is also there. There is nothing red or anything.
My guess is that either it is because the Project from the Jar is compiled in Java 11 or that IntelliJ can not find the class because when I open the jar it is a Spring Boot project and the top-level folders are BOOT-INF and META-INF and the class that I am looking for is in "BOOT-INF -> classes -> com -> ...".
I would really love to know why my IntelliJ can not find the class from this Jar. Is it not possible to use a Java 11 Jar in a Java 8 project? Can anybody help me?