def METHOD_NAME(**kargs):
    command = kargs.get("command")
    app = kargs.get("app")
    args = kargs.get("args")
    play_env = kargs.get("env")
    if 'JAVA_HOME' not in os.environ:
        javadoc_path = "javadoc"
    else:
        javadoc_path = os.path.normpath("%s/bin/javadoc" % os.environ['JAVA_HOME'])
    outdir = os.path.join(app.path, 'javadoc')
    # Clean current javadoc directory
    if (os.path.isdir(outdir)):
        shutil.rmtree(outdir)
    sout = open(os.path.join(app.log_path(), 'javadoc.log'), 'w')
    serr = open(os.path.join(app.log_path(), 'javadoc.err'), 'w')
    # Create Javadoc directory    
    if not os.path.exists(outdir):
        os.makedirs(outdir)      
    defineJavadocOptions(app, outdir, args)
    defineJavadocFiles(app, outdir)
    javadoc_cmd = [javadoc_path, '@'+os.path.join(outdir,'javadocOptions'), '@'+os.path.join(outdir,'javadocFiles')]
    print("Generating Javadoc in " + outdir + "...")
    return_code = subprocess.call(javadoc_cmd, env=os.environ, stdout=sout, stderr=serr)
    # Remove configuration file
    os.remove(os.path.join(outdir , 'javadocOptions'))
    os.remove(os.path.join(outdir , 'javadocFiles'))
    # Display the status
    if return_code != 0:
        print("Unable to create Javadocs.  See " + os.path.join(app.log_path(), 'javadoc.err') + " for errors.")
        sys.exit(return_code)
    print("Done! You can open " + os.path.join(outdir, 'overview-tree.html') + " in your browser.")