DarkNotes icon indicating copy to clipboard operation
DarkNotes copied to clipboard

Bug on some computers

Open OQuerol opened this issue 2 years ago • 0 comments

I have the following code that runs successfully.

class Program
{
    static void Main(string[] args)
    {
        using (dynamic java = CreateVm())
        {
            dynamic s = java.String.@new("Hello");
            dynamic writer = java.DemoCalc.@new();
            int result = writer.MySuperSmartFunctionIDontHaveInJava("Answer to the Ultimate Question of Life, the Universe, and Everything");
        }
    }

    private static dynamic CreateVm()
    {
        string jar321 = @"D:\Users\oquerol\Downloads\jni4net-0.8.8.0-bin\samples\myJavaDemoCalc\democalc_srcJava\myJavaDemoCalculator321.jar";
        string jvm321 = @"C:\\Program Files\\Java\\jdk1.8.0_321\\jre\\bin\\server\\jvm.dll";

        dynamic ret = DarkJava.CreateVm(jvmDllPath: jvm321, attemptVmReuse: true,
            options: new[] { JavaOption.DefineProperty("dark.notes", "rocks"),
                             JavaOption.DefineProperty("dark.notes.rocking", "high"),
                             JavaOption.DefineProperty("java.class.path", jar321)
            }
        );

        ret.ImportPackage("java.io");
        ret.ImportPackage("java.lang");
        ret.ImportPackage("java.text");
        ret.ImportPackage("java.util");
        ret.ImportPackage("System");
        ret.ImportPackage("democalc");

        return ret;
    }
}

However when I run it on another computer I get the following error: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Cannot invoke a non-delegate type

democalc_srcJava.zip DarkNotesDemoApplication.zip

I hope you can help me

OQuerol avatar Dec 23 '22 18:12 OQuerol