Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to stop getting ClassNotFound Error ?  RSS feed

 
Ranch Hand
Posts: 376
  • 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: 4556
112
  • 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: 376
  • 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: 4556
112
  • 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?
 
That new kid is a freak. Show him this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!