void compileClass(Source javaSource,Source javaClass,String sourcePath,boolean isMake) throws ClassNotFoundException {
  try {
    JavaCompilerUtil compiler=JavaCompilerUtil.create(getClassLoader());
    compiler.setClassDir(_classDir);
    compiler.setSourceDir(_sourceDir);
    if (_encoding != null)     compiler.setEncoding(_encoding);
    compiler.setArgs(_args);
    compiler.setCompileParent(!isMake);
    compiler.setSourceExtension(_sourceExt);
    if (_compiler != null)     compiler.setCompiler(_compiler);
    String prefix=_sourceDir.getPath();
    String full=javaSource.getPath();
    String source;
    if (full.startsWith(prefix)) {
      source=full.substring(prefix.length());
      if (source.startsWith("/"))       source=source.substring(1);
    }
 else     source=javaSource.getPath();
    compiler.compileIfModified(source,null);
  }
 catch (  Exception e) {
    log.log(Level.FINEST,e.toString(),e);
    throw new CompileClassNotFound(e);
  }
}

void compileClass ( Source javaSource , Source javaClass , String sourcePath , boolean isMake ) throws ClassNotFoundException { try { JavaCompilerUtil compiler = JavaCompilerUtil . create ( getClassLoader ( ) ) ; compiler . setClassDir ( _classDir ) ; compiler . setSourceDir ( _sourceDir ) ; if ( _encoding != null ) compiler . setEncoding ( _encoding ) ; compiler . setArgs ( _args ) ; compiler . setCompileParent ( ! isMake ) ; compiler . setSourceExtension ( _sourceExt ) ; if ( _compiler != null ) compiler . setCompiler ( _compiler ) ; String prefix = _sourceDir . getPath ( ) ; String full = javaSource . getPath ( ) ; String source ; if ( full . startsWith ( prefix ) ) { source = full . substring ( prefix . length ( ) ) ; if ( source . startsWith ( "/" ) ) source = source . substring ( 1 ) ; } else source = javaSource . getPath ( ) ; compiler . compileIfModified ( source , null ) ; } catch ( Exception e ) { log . log ( Level . FINEST , e . toString ( ) , e ) ; throw new CompileClassNotFound ( e ) ; } }
compile the java source . compile errors are encapsulated in a classnotfound wrapper .
