# ControlP5 in Proclipsing

**URL:** <https://discourse.processing.org/t/controlp5-in-proclipsing/25901>\
**Category:** Libraries\
**Created:** [December 2, 2020, 6:13pm UTC](https://discourse.processing.org/t/controlp5-in-proclipsing/25901 "2020-12-02T18:13:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MouseEars](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@MouseEars](https://discourse.processing.org/u/MouseEars)\
**Post date:** [December 2, 2020, 6:13pm UTC](https://discourse.processing.org/t/controlp5-in-proclipsing/25901/1 "2020-12-02T18:13:12Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [December 2, 2020, 8:21pm UTC](https://discourse.processing.org/t/controlp5-in-proclipsing/25901/2 "2020-12-02T20:21:22Z")

</div>

> [@MouseEars](#):
>
> `ControlP5 cp5 = new ControlP5(this);`

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

---

<div class="post-metadata">

**Author:** ![MouseEars](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@MouseEars](https://discourse.processing.org/u/MouseEars)\
**Post date:** [December 4, 2020, 3:03pm UTC](https://discourse.processing.org/t/controlp5-in-proclipsing/25901/3 "2020-12-04T15:03:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [December 4, 2020, 11:18pm UTC](https://discourse.processing.org/t/controlp5-in-proclipsing/25901/4 "2020-12-04T23:18:38Z")

</div>

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.
