Processing is unable to find all classes and functions from a 3rd party jar file

Hello all,

I posted a while ago here and decided I should generalize my issue more with hopes of finding an answer. If you’re interested in my original specific issue feel free to check out the provided link.

Here is the general issue I am experiencing:
I downloaded a 3rd party library as a .jar file which I then dragged and dropped on my Processing IDE to import the code. It created the “code” folder and added the .jar file to it. When I access the classes and functions in the jar from a new sketch I can correctly use everything provided, but in my current project, there are several class constructors and class functions that aren’t found by Processing.

In my current project, where I am experiencing this issue, I am also using G4P for GUI controls. In the new sketch that I used to test the jar file, I was not using G4P. I don’t think that should make a difference, but I really don’t know.

Has anyone experienced anything like this before? Does anyone have any advice or suggestions on what I can try to solve this issue?

Thank you for your time,
Grayson

1 Like

Just some brainstorming to begin investigating:

  1. Are you certain that they are in the jar, and that you are calling them correctly?
  2. Are you certain that the version of the jar you are using is the same version as the API you are consulting? That is a common cause of missing constructors.
  3. Could there be package conflicts? Are you certain that your sketch is using that local jar – did you install the jar in multiple ways (so maybe the class you are using isn’t coming from the jar you think it is)?

Hi Jeremy,

Thank you for the ideas.

What’s really strange about this is that the classes and functions from the package run normally on my new sketch that was made just for testing the package, but when I use the same library (installed in the same way) on my main project SOME of the class constructors and functions aren’t found. Other classes and functions from the package are found and can be used like normal.

I would still like to know why this is happening, but I did find a work around for my project that used different functions that worked from the package.

1 Like

Glad you found a workaround. I wonder if somehow there some sort of caching issue / intermediate bytecode representation was damaged? It is indeed mysterious.

1 Like