reload static method to reinitialize variables
807603Dec 20 2007 — edited Dec 20 2007I have a class (from an outside package) that uses a static main method to perform a task. I'd like to call this class multiple times with different arguments (passed in as args to the main). However, just calling the main multiple times doesn't seem to work since it is being used within the package to initialize other variables in other classes, and these aren't getting cleared or reset when I run the class with the main method.
I'm sure this is simple, but I haven't seen a way around it yet. I tried use ProcessBuilder, but that seems overly complicated and I'd like to keep within the java environment rather than reaching out to the OS.
I'm using java SE 5.0.
Hope this makes sense.
steve