To get it working, change public static void main(String[] args) {
to public static void main(String[] args) throws Exception {
.
Then read up on exceptions. The ClassLoader#loadClass(String)
method throws the declared exception ClassNotFoundException
. You must handle it, or allow it to be thrown out of your method. Same for the other two errors.