I have created a class in the src folder of my project. When the user clicks a button on the main class, I want it to compile another class (random .java in the same project/src folder) into a jar file and save it to their c drive. Before compiling it, I need to also change a variable inside of the class thats being compiled.
Example:
package Whatever;
//All of my imports...
public static String replaceVar = "This variable in this class needs to be replaced from the other class before being compiled into a .jar on the users C drive!";
public class StubClass {
public static void main(String[] args) {
System.out.println(replaceVar);
}
}
Need any help possible. Thanks in advance!