# \[SOLVED\] PeasyCam raises NoSuchMethodError for PApplet::registerDraw when using Intellij

**URL:** <https://discourse.processing.org/t/solved-peasycam-raises-nosuchmethoderror-for-papplet-registerdraw-when-using-intellij/4535>\
**Category:** Libraries\
**Created:** [October 16, 2018, 11:08am UTC](https://discourse.processing.org/t/solved-peasycam-raises-nosuchmethoderror-for-papplet-registerdraw-when-using-intellij/4535 "2018-10-16T11:08:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReflectiveOperation](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@ReflectiveOperation](https://discourse.processing.org/u/ReflectiveOperation)\
**Post date:** [October 16, 2018, 11:08am UTC](https://discourse.processing.org/t/solved-peasycam-raises-nosuchmethoderror-for-papplet-registerdraw-when-using-intellij/4535/1 "2018-10-16T11:08:36Z")

</div>

Hi, trying to move my project into Intelij\*, but I can’t get PeasyCam to work.  
I’ve added the library to the project, and it correctly recognizes the PeasyCam type, but when I run the sketch I get the following runtimeException:

```auto
java.lang.RuntimeException: java.lang.NoSuchMethodError: processing.core.PApplet.registerDraw(Ljava/lang/Object;)V
	at processing.opengl.PSurfaceJOGL$2.run(PSurfaceJOGL.java:412)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodError: processing.core.PApplet.registerDraw(Ljava/lang/Object;)V
	at peasy.DampedAction.<init>(DampedAction.java:42)
	at peasy.DampedAction.<init>(DampedAction.java:35)
	at peasy.PeasyCam$5.<init>(Unknown Source)
	at peasy.PeasyCam.<init>(Unknown Source)
	at peasy.PeasyCam.<init>(Unknown Source)
	at ExampleApplet.setup(ExampleApplet.java:36)
	at processing.core.PApplet.handleDraw(PApplet.java:2404)
	at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:866)
	at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
	at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
	at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
	at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
	at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
	at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:759)
	at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
	at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:452)
	at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:178)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)

```

Seems to be related to OpenGL, but without PeasyCam I have no problem running P3D sketches, and the jogl libs are available in the project.

\*Not the most reccomended path for beginners, I know, but since my job uses Intelij I’ve grown quite accustumed…

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [October 18, 2018, 2:20pm UTC](https://discourse.processing.org/t/solved-peasycam-raises-nosuchmethoderror-for-papplet-registerdraw-when-using-intellij/4535/2 "2018-10-18T14:20:30Z")

</div>

Hi, I just tried add it to my current project and it works. I have `peasycam.jar` and `peasy-math.jar` added to Global Libraries. I add

```
private PeasyCam cam;

```

to my main class which extends PApplet, and

```
cam = new PeasyCam(this, 400);

```

inside `setup()` (not inside `settings()`!). That’s all.

---

<div class="post-metadata">

**Author:** ![ReflectiveOperation](https://avatars.discourse-cdn.com/v4/letter/r/919ad9/32.png) [@ReflectiveOperation](https://discourse.processing.org/u/ReflectiveOperation)\
**Post date:** [October 19, 2018, 2:40pm UTC](https://discourse.processing.org/t/solved-peasycam-raises-nosuchmethoderror-for-papplet-registerdraw-when-using-intellij/4535/3 "2018-10-19T14:40:32Z")

</div>

I somehow missed the `peasy-math.jar`… Oops.  
Thanks! Hope it’ll be helpful to some other poor fools in the future 😉

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [October 19, 2018, 3:58pm UTC](https://discourse.processing.org/t/solved-peasycam-raises-nosuchmethoderror-for-papplet-registerdraw-when-using-intellij/4535/4 "2018-10-19T15:58:34Z")

</div>

To avoid that problem, when adding a Processing library in IntelliJ Idea, I normally add the whole folder that contains the jar (instead of selecting a specific jar file), because this searches for any jars or system dependent binaries found in that folder and adds them to the project.

The exception to that is when I add the Processing core libraries (or libraries that have OS dependent versions), because I do not want to add Mac or Windows libraries since I’m on Linux. Then I manually select only these:

```
core.jar
gluegen-rt.jar
jogl-all.jar
gluegen-rt-natives-linux-amd64.jar
jogl-all-natives-linux-amd64.jar

```

The last two will depend on the OS you are targeting.
