# Processing Eclipse Java P3D Problem

**URL:** <https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076>\
**Category:** Libraries\
**Created:** [December 12, 2021, 5:33pm UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076 "2021-12-12T17:33:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Herr\_Nerdstrom](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@Herr\_Nerdstrom](https://discourse.processing.org/u/Herr_Nerdstrom)\
**Post date:** [December 12, 2021, 5:33pm UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/1 "2021-12-12T17:33:23Z")

</div>

I’m trying to learn how to use the Processing library with Eclipse to solve a puzzle (Rubik’s Cube) my son challenged me with. The main problem seems to be with using P3D in Eclipse. Here is the test code:

```auto
import processing.core.PApplet;
import processing.core.PConstants;

public class UsingProcessing extends PApplet {

    // The argument passed to main must match the class name
    public static void main(String[] args) {
        PApplet.main("UsingProcessing");
    }

    // method for setting the size of the window
    public void settings(){
       size(500, 500, PConstants.P3D);
// size(500, 500);
    }

    // identical use to setup in Processing IDE except for size()
    public void setup(){
        background(0);
        stroke(255);
        strokeWeight(10);
    }

    // identical use to draw in Prcessing IDE
    public void draw(){
    	line( 0, 0, 500, 500 ) ;
// line(0, 0, 0, 500, 500, 500);
    }
}

```

With the above code, the output window is blank (nothing seems to be rendered), as shown in the left half of the below image. Also, the X to close the window and kill the process doesn’t work – I have to use the Eclipse stop button to halt the process. It doesn’t seem to draw anything, even after waiting several minutes, and the system appears idle.

 ![Untitled](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/b564e4307f4fcdf26e19258eb6d1b745453e15e2.png)

If I remove the P3D option and instead use the two-argument size() method, the image on the right is output. This is the correct test output.

I have tried with Processing 3.5.4 and 4.0b2. I have tried uninstalling the JDK, JRE, and Eclipse, and reinstalling to no avail, despite building new Eclipse projects.

Any ideas what I might be doing wrong, or where else to look?

Thanks.

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [December 15, 2021, 10:36am UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/2 "2021-12-15T10:36:47Z")

</div>

You are probably missing the OpenGL jars, which need to be added to the classpath, the processing ide does this for you.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [December 15, 2021, 11:20am UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/3 "2021-12-15T11:20:38Z")

</div>

Just tried your code on my Eclipse setup and it works so I agree it is probably because you have not linked in the OpenGL library jars.  
This shows my build path -

 ![Screenshot 2021-12-15 at 11.23.35](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4a410523c1c9b8f2b4d59740b1199d036a53e8c8.png)

---

<div class="post-metadata">

**Author:** ![Herr\_Nerdstrom](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@Herr\_Nerdstrom](https://discourse.processing.org/u/Herr_Nerdstrom)\
**Post date:** [December 17, 2021, 1:44am UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/4 "2021-12-17T01:44:48Z")

</div>

Here is a picture of my Eclipse with build libraries included:

 ![Untitled](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/371d2a05fc7d2f727fa3350e12a9edef01d95128.png)

I am missing a few of the libraries you included, namely jl1.0.1.jar and gstreamer-java.jar. Are those also required?

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [December 17, 2021, 9:04am UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/5 "2021-12-17T09:04:55Z")

</div>

You shouldn’t need those two jars, the first is part of the minim library and the second is part of Processing’s video library.

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [December 17, 2021, 12:22pm UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/6 "2021-12-17T12:22:34Z")

</div>

> [@Herr\_Nerdstrom](#):
>
> I am missing a few of the libraries you included

I think you have something weirder going on here. I would have thought you wouldn’t get as far as seeing a window if jars were missing, or at least see an obvious error message.

Maybe try porting the specs test example (from Examples / Demos / Tests) and compare the output in Processing and Eclipse.

```java
size(100, 100, P3D);
PGraphicsOpenGL pg = (PGraphicsOpenGL)g;
println(PGraphicsOpenGL.OPENGL_VENDOR);
println(PGraphicsOpenGL.OPENGL_RENDERER);
println(PGraphicsOpenGL.OPENGL_VERSION);
println(PGraphicsOpenGL.GLSL_VERSION);
println(PGraphicsOpenGL.OPENGL_EXTENSIONS);

```

> [@quark](#):
>
> the second is part of Processing’s video library.

Well, the second is very, very deprecated!

---

<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:** [December 17, 2021, 2:09pm UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/7 "2021-12-17T14:09:39Z")

</div>

Does adding `@Override` before settings, setup and draw make any difference?  
Does a P3D program work in the Processing IDE?  
What OS, GPU and drivers?

---

<div class="post-metadata">

**Author:** ![Herr\_Nerdstrom](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@Herr\_Nerdstrom](https://discourse.processing.org/u/Herr_Nerdstrom)\
**Post date:** [December 19, 2021, 9:06pm UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/8 "2021-12-19T21:06:46Z")

</div>

Thanks for the ideas. I ran the Specs test, and got some interesting results. First, the Specs instance ran and created a blank window, as before. No indications of versions of different PGraphicsOpenGL variables as expected. This caused me to think that something is wrong with how the library draws. So I switched the println()'s as above to System.out.println(), and still nothing (in console or frame).

I moved the System.out.println()'s to the settings() method, and it produced all nulls:

```auto
null
null
null
null
null

```

So I set a breakpoint on the draw( ) method and discovered the method is never reached when using the P3D, but it is called repeatedly for 2D graphics (two arguments to size() method).

All of this is after again uninstalling Eclipse and reinstalling, but this time using a clean .settings folder (on my desktop).

Any further ideas?

---

<div class="post-metadata">

**Author:** ![Herr\_Nerdstrom](https://avatars.discourse-cdn.com/v4/letter/h/59ef9b/32.png) [@Herr\_Nerdstrom](https://discourse.processing.org/u/Herr_Nerdstrom)\
**Post date:** [December 19, 2021, 9:09pm UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/9 "2021-12-19T21:09:04Z")

</div>

Thanks for Override suggestion – no changes observed when explicitly overriding the PApplet methods.

Yes, this does work with the PDE.

This is on Windows 10 (current patch level), on an Alienware laptop with nVidia GeForce GTX 1660 Ti display adapter.

---

<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:** [December 19, 2021, 10:00pm UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/10 "2021-12-19T22:00:17Z")

</div>

Maybe the Java version? I remember having issues unless I used the Adopt JDK version, and if I remember right using the most recent version didn’t work when I tried. It works fine for me with P3D in IntelliJ Idea with Java 14.

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [December 20, 2021, 10:03am UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/11 "2021-12-20T10:03:09Z")

</div>

There used to be a linker issue with certain versions of JDK on linux, but that seems to be gone now [Choice of OpenJDK is Critical - #4 by monkstone](https://discourse.processing.org/t/choice-of-openjdk-is-critical/16141/4), maybe it persists with Windows? Generally I don’t rely on an ide to pull in dependencies, I prefer to set up a maven project, but then I never got on with Eclipse preferring Netbeans, however any half decent ide should be able to cope with a maven project. That @quark got your project to run suggests something odd about your setup.

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [December 20, 2021, 4:34pm UTC](https://discourse.processing.org/t/processing-eclipse-java-p3d-problem/34076/12 "2021-12-20T16:34:04Z")

</div>

> [@Herr\_Nerdstrom](#):
>
> Thanks for Override suggestion – no changes observed when explicitly overriding the PApplet methods.

Yes, annotations are metadata - they don’t change behaviour of the code. In particular, this one just tells the compiler to flag an error if the method _isn’t_ an override to catch problems.

> [@Herr\_Nerdstrom](#):
>
> This is on Windows 10 (current patch level), on an Alienware laptop with nVidia GeForce GTX 1660 Ti display adapter.

Is this with Optimus? I was curious at the results for the spec test in Processing and Eclipse to see if you had different GPUs / drivers in play. If so, is there a way you can test with a forced GPU choice?

> [@hamoid](#):
>
> Maybe the Java version?

Always a possibility! Can you compile in Eclipse but run against the JDK inside the Processing installation? Eclipse should have an option for running projects against a different JDK to the one you’re running the IDE on, somewhere … (not my choice of IDE)

> [@monkstone](#):
>
> Generally I don’t rely on an ide to pull in dependencies, I prefer to set up a maven project, but then I never got on with Eclipse preferring Netbeans, however any half decent ide should be able to cope with a maven project.

As a NetBeans release manager, and a big fan of Maven, I cannot help but agree! 😄
