public void generate(ClassNode root, PeerGenSettings peerGenSettings)
            throws java.io.IOException {
        String fullFileName = peerGenSettings.getProject().getJavaOutputDir() + File.separatorChar;
        if (root.getPackageName().equals("") == true) {
            fullFileName = root.getCPPClassName() + "Proxy.java";
        } else {
            fullFileName = root.getPackageName().replace('.', File.separatorChar) + File.separatorChar + root.getCPPClassName() + "Proxy.java";
        }

        FormattedFileWriter writer = new FormattedFileWriter(fullFileName);

        writer.outputLine("package " + root.getPackageName() + ";");
        writer.newLine(1);

        writer.outputLine("import " + root.getPackageName() + "." + root.getClassName() + ";");
        writer.newLine(1);
        writer.outputLine("public class " + root.getClassName() + "Proxy");
        writer.incTabLevel();
        writer.outputLine("implements " + root.getClassName());
        writer.decTabLevel();
        writer.outputLine("{");
        writer.incTabLevel();
        writer.outputLine("private long peerPtr = 0;");
        writer.newLine(1);
        generateMethods(root, writer);
        writer.newLine(1);
        writer.outputLine("static");
        writer.outputLine("{");
        writer.incTabLevel();
        writer.outputLine("System.loadLibrary( \"" + peerGenSettings.getProject().getTargetName() + "\" );");
        writer.outputLine("init();");
        writer.decTabLevel();
        writer.outputLine("}");
        writer.decTabLevel();
        writer.outputLine("}");
        writer.flush();
        writer.close();

        /*
         String javacCommand = null;
         String sourceDir = peerGenSettings.getProject().getJavaOutputDir();
         javacCommand = (javacCommand == null ? "javac" : javacCommand);
         String source = sourceDir + File.separatorChar;
         if ( root.getPackageName().equals( "" ) == false )
         source += root.getPackageName().replace( '.', File.separatorChar ) + File.separatorChar;
         source += root.getClassName() + "Proxy.java";
         System.out.println( "compiling " + source + " ..." );
         String cmd = javacCommand + " " + source;
         Process proc = Runtime.getRuntime().exec( cmd );
         new RuntimeExecStreamHandler( proc.getErrorStream() ).start();
         new RuntimeExecStreamHandler( proc.getInputStream() ).start();
         int result = 0;
		
         try
         {
         result = proc.waitFor();
         }
         catch(InterruptedException ex)
         {
         }
         */
    }