1

I'm trying to import dependency with maven to Intellij. And I edited pom.xml like this:

<dependencies> <dependency> <groupId>net.dv8tion</groupId> <artifactId>JDA</artifactId> <version>4.2.0_214</version> </dependency> </dependencies> <repositories> <repository> <id>jcenter</id> <name>jcenter-bintray</name> <url>https://jcenter.bintray.com</url> </repository> </repositories> 

and I checked if dependencies are well added. Dependencies list

And I wrote below code in my project.

import net.dv8tion.jda.*; public class main { public static void main(String args[]) {} } 

The result is.. I got error: java: package net.dv8tion.jda does not exist
I did maven Reload project and Invalidate caches and I still getting same error.
I wonder why this happens and how to fix.

2
  • which version of IntelliJ are you using? Commented Nov 8, 2020 at 8:44
  • According to Ahmed Salem's answer for this question stackoverflow.com/questions/20137020/… there is a bug in IntelliJ version 2020.1 and 2020.1.1 Commented Nov 8, 2020 at 9:11

1 Answer 1

2

This is what worked for me: File -> Invalidate Caches/Restart, then Build -> Rebuild project

I could then import JDABuilder or other classes.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.