Search code examples
javalibraries

How to use a .JAR file class in my project (Eclipse)


I am trying to use a class from org.apache.commons.lang3.ArrayUtils;

I have alread imported the .JAR file into my classpath in ecplise. You can see in the picture below.

https://i.sstatic.net/cg2YJ.png [<image here]

When I hover over the error for ArrayUtils.indexOf (circle in blue). It gives me no option to import class for ArrayUtils.

This is a photo of the .JAR: https://i.sstatic.net/WN7pw.png

I cannot figure out how to use ArrayUtils in my code without an error.

I am still learning Java any help will be appreciated, I have looked at a similar question already: how do I import org.apache.commons.lang3.ArrayUtils; into Eclipse

and it did not help me specifically.


Solution

  • Also, import on the top

    import org.apache.commons.lang3.ArrayUtils;

    shortcut key to import in eclipse is ctrl+space