How do I make a moddable game in Java?

How would I make a moddable game in Java with the Java ClassLoader, I can’t seem to find anything related to what I’m trying to do with my game. In my game I want it to do the same thing that Forge Mod Loader for Minecraft does(It finds the mods in a specific folder and loads them). I want people or a community of people to be able to easily modify my game. I already know that I would need to create some kind of API but the only problem is how to find and load the JAR file then run it from a ‘main’ method. If anyone could help me with this topic and or has any questions about my question just say.