List<ClassInfo> classInfo = Javac.compile(sourceCode); //I am using the kilim tools javac compiler
URLClassLoader classLoader = URLClassLoader.newInstance(classUrls); //constructing the classURLs as a list of the urls of jars of the JVM and the location of the current .class
Weaver weaver = new Weaver(clsLoader);
List<ClassInfo> weavedClassInfo = weaver.weave(classInfo); //The output of weaving is just one class which was passed as input. However, the bytes are modified
Class<?> cls = (Class<?>) Class.forName(weavedClassInfo.className, true, classLoader);
Task task = (Task)cls.newInstance();
Scheduler s = new Scheduler(1);
task.setScheduler(s);
task.start();
I am invoking the start method of the Task class by the above steps.
With the above steps, I get an error message:
"Task C has either not been woven or the classpath is incorrect"
Since weaving has modifid my classBytes, is my classpath incorrect? Any ideas on how do I go about fixing it?
Thanks!