Use NetBeans like Tartiflette suggested. It's pretty much the standard for the modding community and there are a lot of tutorials for it on the forums.
You don't actually need to compile anything for a mod to work. Loose .java files get automatically compiled and run when SS starts if they're in the right spots. I would actually recommend avoiding compiling anything into a .jar until you've gotten your mod to work with as .java files as a first step.
In my mind the best mods to use as a reference coding-wise are Shadowyards (well done, sort of became the standard reference because it was the first mod to work with 0.65) and the Mayorate (slightly biased 'cause it's mine, but the code is quite simple and has a lot of comments everywhere). If you want to learn how to use Java effectively, I recommend this course
here. The course/assignments are quite hard, but will give you a good grasp of how things work.