Is it possible in java to programmatically run a java program?
For example, having a runnable class loaded and run as a thread?
EDIT
I see that I should have been more precise 🙂
I’ve got a .class file that I want to read and run.
The idé is that I have no ide what kind of program it is, only that it is a valid class file.
What I want to do is to be able to run the .class file as if I myself had written and compiled it.
Yes, you can do it through reflection if you want to execute the code within your process.
I haven’t tested this code, but it should looks something like this: