You do not need a desktop environment to run JUCE but you do need X11. No matter what type of graphics you are using, you need some kind of display backend (even for OpenGL or OpenGL ES) to handle user input (mouse, keyboard, etc.) and events. X11 is the most popular display backend and used by all major linux desktops but you don’t need to install a desktop environment to be able to use X11. There are other display backends such as wayland. Wayland is up-and-coming and a lot more light-weight than X11 but not supported by JUCE yet.
OpenGL is just a graphics accelerator. If your graphics are too slow then you should consider using OpenGL. But you still need some kind of display backend to actually show the graphics and process the input. OpenGL ES does allow you to display graphics without running a display backend but you still need something that would handle events and user input.
As mentioned above, if your using JUCE you will need to run your app under X11. If your graphics are too slow, you can speed them up with OpenGL. This is very easy to do with JUCE. Simply attach an OpenGLContext to your top-level component.
It’s easy to test-run your JUCE app without a desktop environment:
Most distributions will boot into a desktop environment (GNOME/KDE/XFCE/…) so you will need to kill the desktop session. SSH into your raspberry pi and kill the display manager:
sudo /etc/init.d/lightdm stop
You might be running a different display manager (for example
mdm) so you may want to replace lightdm with something else.
Then on a root shell start the X server:
On a different shell (ssh into your raspberry pi from a new terminal) type-in