Search code examples
springspring-mvcspring-bootspring-restcontroller

ClassNotFoundException exception after adding external jar to spring WEBAPI


I am building a spring restful service for which I am adding third part jar with java build path

1. I created lib folder in project and copied the jar to that file
2. from there I have added that to build path.
3. When I run that project, I getClassNotFoundException.

anyone can suggest what should be the issue thanks

enter image description here


Solution

  • Because your jar file is not available at runtime.

    In order for it to be available at runtime ,just add jar file in your java build path like this:

    enter image description here

    Hope this helps..!