code: public static boolean compileJavaClass(String sourceCode) {
  		try {
  			String fileName = getClassName(sourceCode).concat(".java");
  			logger.info("Compiling Java Class ({})", fileName);
  
  			File rootDir = JKIOUtil.createTempDirectory();
  			String packageDir = getPackageDir(sourceCode);
  			File sourceFile ;
  			if(packageDir!=null) {
  				File file=new File(rootDir,packageDir);
  				file.mkdirs();
  				sourceFile=new File(file, fileName);
  			}else {
  				sourceFile=new File(rootDir, fileName);
  			}
  
  			JKIOUtil.writeDataToFile(sourceCode, sourceFile);
  
  			// Compile source file.
  			JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
  			StandardJavaFileManager standardJavaFileManager = compiler.getStandardFileManager(null, null, null);
  
  			standardJavaFileManager.setLocation(StandardLocation.CLASS_PATH, getClassPath());
  			standardJavaFileManager.setLocation(StandardLocation.SOURCE_PATH, Arrays.asList(rootDir));
  
  			List<String> options = new ArrayList<String>();
  
  			options.add("-Xlint:unchecked");
  
  			CompilationTask compilationTask = compiler.getTask(null, standardJavaFileManager, null, options, null,
  					standardJavaFileManager.getJavaFileObjectsFromFiles(JK.toList(sourceFile)));
  
  			return compilationTask.call();
  		} catch (IOException e) {
  			JK.throww(e);
  			return false;
  		}
  
  //		if (compiler.run(System.in, System.out, System.err, sourceFile.getPath()) != 0) {
  //			JK.error("Compilation failed, check stack trace");
  //		}
  	}
docs: Compile java class.
  
  @param sourceCode the source code
  @throws IOException