Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at nl.siegmann.epublib.epub.EpubReader.<clinit>(EpubReader.java:33) #115

Open
d4rKn1ght opened this issue Oct 23, 2017 · 1 comment

Comments

@d4rKn1ght
Copy link

trying on a Simple Java program to read an epub file and display the Author (metadata):

    try {
        
         System.out.println("Inside Try block");
        
         EpubReader ereader = new EpubReader();
    
          Book ebook = ereader.readEpub(new FileInputStream(filepath));
          List<String> titles = ebook.getMetadata().getTitles();
    
          System.out.println("book title:" + (titles.isEmpty() ? "book has no title" : titles.get(0)));
 }
    catch(Exception e)  {
        System.out.println("Exception: "+ e);
    }

This throws the exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at nl.siegmann.epublib.epub.EpubReader.(EpubReader.java:33)
at epub_test.EPUB_TEST.main(EPUB_TEST.java:57)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

I have imported "epublib-core-latest.jar" - and downloaded this file from: https://github.com/psiegman/epublib/epublib-core-latest.jar

@Neschastje
Copy link

You have to add slf4j lib to your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants