I am having problems importing classes from a JAR library into my project. Please see the screenshot.
I have tried several things both in Eclipse and IntelliJ, both adding directly and adding through Maven. None of this helps, I still get a red underline.
In IntelliJ I tried:
- Project Structure - Modules - Dependencies - Add jar.
- Tried creating a lib folder, add it as a library and place the jar inside and then setup as dependency.
- Adding through maven pom.xml with direct path to the jar.
In Eclipse I tried:
- Java Build Path and adding it to my build path.
- Maven - Update Project.
Here is my pom.xml to get the local jar.
<dependency>
<groupId>uk.co.pervasive_intelligence.simulator</groupId>
<artifactId>protocol</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>C:\Users\Vas-DELL\Desktop\simulator-1.2.2.jar</systemPath>
</dependency>
Strangely, I am able to see the jar and the classes inside the jar (screenshot). But still can not import them. Let me know please if there is anything else I can provide.