0

I tried 2 different adding 2 different API's to my project but I got the same error both.

I already added library to classpath but it gives the error.

ERROR IMG

I don't know if I did something wrong so here is another screen capture that shows how I added the JAR:

enter image description here

I tried compiling the library myself and adding it but it did not work either.

Egor Klepikov
  • 3,386
  • 5
  • 19
  • 34
Can Tam
  • 5
  • 1
  • 4
  • Hi why not use some build tool like maven which can handle dependencies for you? You can then load your project as a Maven Project in intellij – Rohan Kumar Jul 13 '21 at 09:30

2 Answers2

2

To solve the problem you can try to do the following:

  • Delete the .jar file from Project Structure | Modules | forge-*** | Dependencies

  • Go to Project Structure | Libraries

  • Click +, select the jar file and select the modules you want to add it to.

  • Go to PasteBin class, point the cursor at Pastebin, press Alt + Enter and import the class.

See https://www.jetbrains.com/help/idea/library.html on how to manage libraries in IntelliJ IDEA.

Egor Klepikov
  • 3,386
  • 5
  • 19
  • 34
0

Use maven or just add your library to the lib directory, also take a look at:https://stackoverflow.com/a/32853178/3631239

  • I followed the things i saw at "https://stackoverflow.com/a/32853178/3631239" but now it tells me to add "libs" to classpath. I think im typing the "dependencies" in the wrong place here is my "build.gradle": https://pastebin.com/zUc4gea5 – Can Tam Jul 13 '21 at 10:12