Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

How to stop getting ClassNotFound Error ?  RSS feed

 
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have set up my pom.xml but somehow the jar files are not made available in my build path.

Previously, I did not have to put everything on the build path manually since all my Maven dependencies are already showing in the build path.

But, I kept getting many ClassNotFound error and I have to keep adding them manually.

One example of this ClassNotFound is here in the attachment.

I hope someone can tell me how to make the Eclipse IDE Neon aware of all the dependencies in my Maven.

Tks.
keeps-getting-classNotFoundError.jpg
[Thumbnail for keeps-getting-classNotFoundError.jpg]
 
Saloon Keeper
Posts: 5038
134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a runtime error message, not a build time message. Be aware that there are two different classpaths in play: one for the build, and one for use at runtime. Both need to include all required libraries.
 
tangara goh
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:That is a runtime error message, not a build time message. Be aware that there are two different classpaths in play: one for the build, and one for use at runtime. Both need to include all required libraries.




Hello Tim,

I have searched the internet for an answer but just can't find one which shows me the step to include the jars in my pom.xml to be available at runtime.

Could you tell me how-to?

So far, I have include maven library which contains all the jars needed in deployment assemblies.

I am not sure where I can include it in runtime.
 
Tim Moores
Saloon Keeper
Posts: 5038
134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on how you run this code. Does Maven create a war file? If so, does it include all jar files? If not, how is the code being run?
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
Download Free Java APIs to Work with Office Files and PDF
htttp://www.e-iceblue.com/free-apis.html
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!