No, you cannot simply just pull out a .class file, make changes, and stick it back in. That’s simply just not how this works.
For editing .java files; I highly recommend using an IDE (Integrated Development Environment). Yes, even for this simple change.
Why? Well, you can rebuild the .jar file in a single click using one. So that means you can make your modifications, click, boom, new modified jar.
The devs were nice enough to include multiple setup guides for different IDEs.