Processing is built on top of Java. It shares Java’s syntax- so by learning Processing, you’re learning Java.
You can write Processing code in Java, and you can write Java code in Processing.
What makes it different is two things:
1- Processing, at its core, is a Java library that does a ton of visual stuff for you. Out of the box you have access to an OpenGL wrapper, a 60 fps game loop, and a bunch of methods that do some pretty cool stuff for you.
2- The Processing IDE is designed to make it super easy to write Processing code. You don’t worry about the JRE, compiling, the classpath, etc. You hit play and your code runs. I can’t understate how awesome that is, especially for a novice.
If you’re just starting out, Processing, imho, is definitely the way to go. Even if you aren’t just starting out, it’s worth checking out.
If you know a little bit of Java, then stick with Java2D and make a few simple games before moving on.
If you’re an experienced Java developer, then libGDX is a game changer, no pun intended.
It’s also worth noting that you can export Processing applications (in the Processing vernacular, they’re called sketches) as JavaScript using Processing.js.