0

when i add slf4j-api-1.6.4.jar and slf4j-nop-1.6.4.jar in my libs folder it works fine but if i replaced them with gradle dependency then while executing the jar it gives me below error.

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

these are gradle dependencies for my project for above libraries.

compile group: 'org.slf4j', name: 'slf4j-api', version: '1.6.4'
compile group: 'org.slf4j', name: 'slf4j-nop', version: '1.6.4'
Swapnil
  • 654
  • 7
  • 27
  • Possible duplicate of [XUGGLE ERROR: Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory](http://stackoverflow.com/questions/13434862/xuggle-error-exception-in-thread-main-java-lang-noclassdeffounderror-org-slf) – hpopiolkiewicz Dec 01 '16 at 14:52
  • @user629735 but why its not working when i compile from gradle instead of lib class path – Swapnil Dec 01 '16 at 15:02
  • What folder is it you talk about when you say "my libs folder" and how do you execute the JAR? – Vampire Dec 01 '16 at 15:06
  • Hm the neeed jar files must be downloaded . To do so make sure you run Grandle Build . So in your classpath you have to see a folder named `Artifacts and Depencities` or something like that and inside it needs to have the jar files . Also do a fresh clean in your project . – GOXR3PLUS Dec 01 '16 at 15:26

2 Answers2

0

Make sure you've run Gradle Build, it may not have pulled your dependencies.

Hans
  • 531
  • 1
  • 4
  • 19
0

Make sure that you include these dependencies in the jar file (like this).

hgminh
  • 1,178
  • 1
  • 8
  • 26