public void Invoke(params string[] args)
		{
			try
			{
				// http://bigjavablog.blogspot.com/2008/08/load-jar-files-and-java-classes.html

				if (Method != null)
				{
					var main_args = new string[0];

					this.Method.invoke(null, new object[] { main_args });
				}
				else
				{
					/* We need and URL to load the jar file. */
					URL u = new File(this.AssemblyPath).toURL();
					/* Load jar file using URLClassLoader. */
					URLClassLoader cl = new URLClassLoader(new URL[] { u });

					if (NativeAssemblyPath != null)
					{
						var nc = cl.loadClass("jni.CPtrLibrary");
						var ncf = nc.getField("LibraryPath");

						ncf.set(null, NativeAssemblyPath);
					}

					var c = cl.loadClass(this.TypeName);

					foreach (var m in c.getMethods())
					{
						if (m.getDeclaringClass() == c)
						{
							if (m.getName() == "main")
							{
								this.Method = m;

								var main_args = new string[0];

								this.Method.invoke(null, new object[] { main_args });
							}
						}
					}
				}

			}
			catch (csharp.ThrowableException ex)
			{
				var exo = (object)ex;

				Console.WriteLine("error!");
				Console.WriteLine(ex.Message + " - " + ex.ToString());

				ErrorHandler(exo);

			}
		}
        public JavaArchiveReflector(FileInfo jar)
        {
            this.FileName = jar;

            var clazzLoader = default(URLClassLoader);

            try
            {
                var filePath = "jar:file://" + jar.FullName + "!/";
                var url = new java.io.File(filePath).toURL();


                clazzLoader = new URLClassLoader(new URL[] { url });
            }
            catch
            {
            }



            this.GetDynamicEnumerator = () =>
            {

                var zip = default(ZipInputStream);

                try
                {
                    zip = new ZipInputStream(new FileInputStream(jar.FullName));
                }
                catch
                {
                }

                return (GetNextEntry)
                    delegate
                    {
                        if (zip == null)
                            return null;

                        var e = default(ZipEntry);

                        try
                        {
                            e = zip.getNextEntry();
                        }
                        catch
                        {
                        }

                        if (e == null)
                            return null;



                        var n = new Entry { Name = e.getName() };

                        if (clazzLoader != null)
                            if (n.Name.EndsWith(".class"))
                            {

                                n.TypeFullName = n.Name.Substring(0, n.Name.Length - ".class".Length).Replace("/", ".");


                                n.InternalGetType = delegate
                                {

                                    var c = default(java.lang.Class);

                                    try
                                    {
                                        c = clazzLoader.loadClass(n.TypeFullName.Replace(".", "/"));
                                    }
                                    catch (csharp.ThrowableException cc)
                                    {
                                        System.Console.WriteLine("error: " + cc);
                                    }

                                    return c.ToType();
                                };
                            }

                        return n;
                    };
            };
        }