You can't use an arbitrary jar "as is".

You can wrap libraries as cn1libs: https://www.codenameone.com/cn1libs.html but a library might use arbitrary Java code which might be a problem see https://www.codenameone.com/blog/why-we-dont-support-the-full-java-api.html

We have a tutorial on porting native OS SDK's to Codename One in the developer guide and in video form https://www.codenameone.com/blog/integrating-3rd-party-native-sdks-part-1.html

There are a lot of 3rd party libraries adapted to Codename One and most of them are open source. e.g. this one enables camera preview https://github.com/codenameone/CameraKitCodenameOne
You can use that as a sample starting point.
Was this article helpful?
Thank you!