I am writing a java program that uses both pre-made and custom created methods from outside classes (classes outside the compiled .jar). Basically, at one point it asks you to select the file to use for the method. The file it asks you to choose is a java class file (.java because it will not be compiled yet). It then compiles and parses the file as if it were part of the program (.jar). Here is my question: is there any way to compile a file that is outside of the program .jar file and then parse it as if it were part of the program?
If it helps, here is some of the code that is included in the compiler/parser class inside the program, and also the code that should be included in the outside class:
Inside class:
public class CryptorLoader {
public static void compile() {
}
public static void parse() {
}
}
Outside class:
public class (name of custom class goes here) extends CryptorLoader() {
public static void method() {
}
}
I don't know if the extends CryptorLoader
is necessary, but there will be code and variables in the inside class that will be used by the outside class. Any help would be greatly appreciated.
Thanks in advance,
Santiago