Ejemplo n.º 1
0
        private void CompileJavaProgram()
        {
            String code = @"
package com.db4o.test.aliases;

import com.db4o.*;

class Person2 {
	String _name;
	public Person2(String name) {
		_name = name;
	}
}

public class Program {
	public static void main(String[] args) {
		String fname = args[0];
		ObjectContainer container = Db4o.openFile(fname);
		container.store(new Person2(""Homer Simpson""));
		container.store(new Person2(""John Cleese""));
		container.close();
		System.out.println(""success"");
	}
}";

            JavaServices.ResetJavaTempPath();
            string stdout = JavaServices.CompileJavaCode("com/db4o/test/aliases/Program.java", code);

            Console.WriteLine(stdout);
        }
Ejemplo n.º 2
0
        private void CompileJavaSnippet()
        {
            JavaServices.ResetJavaTempPath();
            JavaSnippet program = JavaCode();
            string      stdout  = JavaServices.CompileJavaCode(program.MainClassFile, program.SourceCode);

            Console.WriteLine(stdout);
        }
        private void CompileJavaCode()
        {
            JavaSnippet snippet = JavaCode();

            JavaServices.ResetJavaTempPath();
            string @out = JavaServices.CompileJavaCode(snippet.MainClassFile, PopulateItemValues(snippet.SourceCode));

            Console.Error.WriteLine(@out);
        }