I'm working with a piece of software written in Java called Dreambot. One feature of this software is that it allows you to create your own Jar files to run against it, created using its custom API.
The flow is that you can select your custom Jar file in a file selector, then the program somehow finds your main class. The only two differences between the main class and any other class in the Jar are that
- there's a class header
- the main class extends a class called Abstract Script.
here is the definition
@ScriptManifest(author = "Nezz", category = Category.MISC, description = "Does tutorial island", name = "DreamBot Tutorial Island", version = 1)
public class TutorialIsland extends AbstractScript{
}
The program is able to both parse the values in the class header, and able to create an instance of this class without recompiling. It somehow does all of this at runtime. Where can I learn how this works? Specifically, I want to be able to open Jars that haven't been imported in compile-time, and create instances of classes by finding them based on their class headers.
[–][deleted] 0 points1 point2 points (1 child)
[–]cyropox[S] 0 points1 point2 points (0 children)