This question already has an answer here:
- How do I call a Scala Object method using reflection? 3 answers
I'd like to call the object main method using reflection in scala. But it did not works, the following 2 lines of code will through exception that I could not create the object using reflection.
val clazz = Class.forName(job.runnerClass)
val runnerClass = clazz.newInstance()