Compiler compiler = new Compiler();
List<JavaClassFileObject> files = compiler.compile("foo.A", "package foo;\n public class A {}");
assertEquals(1, files.size());
JavaClassFileObject aFile = files.get(0);
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "crash.jar");
jar.add(new ByteArrayAsset(aFile.getBytes()), "foo/A.class");
jar.setManifest(Thread.currentThread().getContextClassLoader().getResource("META-INF/MANIFEST.MF"));
ClassLoader cl = factory.getClassLoader(jar);
//
compiler = new Compiler(cl);