} else {
try {
ByteArrayOutputStream bos =
new ByteArrayOutputStream();
PrintWriter pw = new PrintWriter(bos);
Main compiler = new Main();
int ret = compiler.compile(cmds, pw);
if (ret != 0) {
byte[] errorBytes = bos.toByteArray();
String errorString = new String(errorBytes);
throw new JavaCompilerException(
"java_compiler.error", "Native compiler returned an error: {0}\nError messages are: {1}", new Object[] { new Integer (ret), errorString } );