External Libraries have unique content and structure. Each may pose special challenges as you try to use it in robot code. Communication with the library developer will be very helpful, perhaps essential.
Ideally, the library’s .jar or .aar file encompasses all the classes you’ll need, without external dependencies. A good example is EasyOpenCV, designed and ready for use. See the simple instructions here (https://github.com/OpenFTC/EasyOpenCV).
General external libraries might involve a longer journey. For example, Apache Commons (https://commons.apache.org/) is a vast public repo, basically a library of libraries, focused on the Java programming language. Complications can arise even when choosing a simple math-only library.
Apache libraries are organized into Modules, typically each with one or more .jar files. It may not be sufficient to upload only the .jar file that seems to contain the class and methods you want to use.
If the library code refers to a class not contained in that .jar file, OnBot Java’s auto-complete feature may eventually throw a ‘class not found’ exception, causing your RC app to crash. The exception triggered by this ‘hidden dependency’ may occur within minutes or hours, whenever OBJ encounters the ‘missing’ class – even if your OpMode does not directly or indirectly use that class. After that point, your RC app will not operate. It can operate again only by manually deleting the .jar file and its associated folder, directly on the RC device.
Starting over, you can find and upload the .jar file containing the ‘missing’ class. But that may expose further dependencies, requiring more .jar files.
Also, be aware that the SDK already contains some common Apache classes. OnBot Java may detect this duplication, preventing upload of your .jar file. On the bright side, your desired methods should already be available!
So, be prepared for these and other challenges that may arise. Again, it’s helpful to communicate with the library developer where possible.