ClassNotFoundException issues using org.apache.commons.collections in Eclipse IDE

865 views Asked by At

I'm very new to Eclipse (I used to use InteliJ) and I've got much of it sorted out but this is an issue that I just can't wrap my head arounds. I'm not sure if this has been asked already and I'm simply not asking the correct question so please be merciful. I need to emphasize that this code worked as intended when I was running it in InteliJ so it's not an issue with the code as far as I can see.

The program uses JavaFX and the bi-directional hashmap from the commons.collections and JavaFX does run properly.

The issue occurs when I attempt to use the commons.collections in the eclipse project. I added the library in the same way that I added the JavaFX files but when it runs, I get this error message.

java.lang.ClassNotFoundException: org.apache.commons.collections4.BidiMap

I'm not sure what I'm doing wrong and my google searches just keep turning me towards Maven but I don't want to use Maven if I can avoid it. Picture of Eclipse

I've included a picture of the library setup from InteliJ as well and from what I can tell, I need to include the Javadocs folder but I can't seem to find out how. Nothing I've done thus far has given much of a hint.

enter image description here

I really appreciate any help at all!

UPDATE

I added the commons-collections4-4.4 to my class path and the same error is occurring.

Picture Included enter image description here

1

There are 1 answers

0
TeaDrinker On

In order to fix my issue, I needed to add the library to my class path. I had added it to my module path but that simply wasn't enough as it turns out.

This page can be accessed using

properties -> Java Build Path -> libraries.

One thing I learned is that it's best to click the "Add External JARS..." and not "Add External Class Folder".

Here's an example of my final configuration.

enter image description here