I have a gradle project that builds perfectly. The jar runs perfectly. When I try to import it into IntelliJ via gradle, I get the following error:
Unable to load class 'org.slf4j.LoggerFactory'.
I don't even use that within my project.
Any ideas?
Here is a gist with the log: https://gist.github.com/anonymous/991f8daab0ff3047db9a11d015492fe5
Also, an screen shot for reference: http://imgur.com/a/2ptIY
I had a similar problem: while trying to open a Gradle project, IntelliJ throws an error: Unable to load class 'org.slf4j.LoggerFactory'.
Instead of the local gradle distribution, choose the "use gradle wrapper" task configuration option. You can change this in Settings | Build, Execution, Deployment | Gradle | Project-level settings
IntelliJ uses it internally alongside many other libraries - you may want to check the JAR to see if it's still valid. It lives in <INTELLIJ_DIR>/lib
. If not, you can replace it manually (IntellIJ 2016.2 packages log4j 1.2). If you encounter further issues, you may have other corrupted libraries (at least that was the case when this happened to me). As far as I'm aware there's no simple way to repopulate the lib
folder, so the cleanest solution may just be a reinstall of the IDE if it proves to be tedious to manually fix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With