An example Java (Intellij) project that uses Processing library but will work outside of the Processing IDE.
Note that the project has multiple branches, with differing levels of complexity.
This project bundles all the required Processing libraries. This isn't a best-practice, but keeps things very simple.