I thought of creating a Custom ClassLoader to know how it works. I went to this site
Custom Class Loader and copied the code to my STS.
When i try running from my command prompt, i get the desired output like below.As the site says, I only compiled "CCLRun.java" and "CompilingClassLoader.java". I leave rest of the files to be compiled by my Custom Class Loader.
now i do below
%
java CCLRun Foo arg1 arg2
and i get the desired ouptut like below
CCL: Compiling Foo.java...
foo! arg1 arg2
bar! arg1 arg2
baz! arg1 arg2
CCL: Compiling Boo.java...
Boo!
Now i thought i will try the same in my STS, so that i can debug it and see the execution of the code.
What i did was rt click on the project-->Debug as-->Debug Configurations-->Arguments.
In arguments i give
name as CCLRun and
program arguments as Foo arg1 arg2.
But when i try above i get below exception
What can the problem be?