Load Java classes at runtime in a program
I want to know, if it is posible to load a folder route or a package, which has some .java files and compile it at runtime and then instantiate the classes so I can create objects of that clases ?? I read that it is possible, but I saw a few methods, and none satisfied me. What I want is just to compile the .java files and then create objects of the classes at runtime. I will really appreciate some help. I just the way of how to do it.
Thanks in advance.
Re: Load Java classes at runtime in a program
Check out the javax.tools package. Note that it's not part of the JRE; for a computer to run code using javax.tools, a JDK must be installed.