So again this is one of my Java minecraft plugins, and I'm trying to make a command that runs a specific code that will run on the server, so what I stumbled on is
String code = "package code; \n"
+ "public class MyClass { \n"
+ " public void myMethod(){ \n"
+ " " + args[1] + "\n"
+ " } \n"
+ "}";
Dir.save(code, new File(getDataFolder(), "MyClass.java"));
so this is my code it will try to save the string in a file, btw please tell me if this string will work as it is meant to be. then what I want to do In here is that I want to compile this file and run it in my server, its like an external file out side the program, so how do I do it. How do I run this MyClass.java with the libraries of the server's codes, because I want the code to run with what the server offers from classes!