ControlP5 in Proclipsing

Hi! I’ve been using the Proclipsing plugin to Eclipse to import some code that was originally written in the Processing IDE so that I can work with it more like regular Java.

The code works fine in the Processing IDE, but After getting rid of the syntax differences, I get a Null Pointer Exception in the ControlP5 class, which is thrown from this declaration:

ControlP5 cp5 = new ControlP5(this);

The error stack after that declaration goes:
ControlP5.(PApplet) line: not available
ControlP5.init() line: not available [local variables unavailable]

with the latter being the final breaking error.

I can’t change the controlP5 code, has anyone else had this problem and know how to fix it? Is it something wrong with my declaration?

Where are you calling ControlP5 cp5 = new ControlP5(this); from?

In an initcontrols method that’s called from the setup method. Just because I’m setting a lot of things up and wanted to keep them all grouped together. The setup method contains two methods, one for Box2DProcessing and the other for ControlP5 if that makes sense.

A null pointer there (with this being the null value) would arise from trying to instantiate CP5 before the PApplet is created (i.e. outside of setup()). But if you’re sure that you’re calling it from within setup() then you’ll have to post your code.