Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 创建项目的Exe后DLL方法不工作_Java_C#_Methods_Dll_Java Native Interface - Fatal编程技术网

Java 创建项目的Exe后DLL方法不工作

Java 创建项目的Exe后DLL方法不工作,java,c#,methods,dll,java-native-interface,Java,C#,Methods,Dll,Java Native Interface,我从dll文件中调用display方法,这在我运行java项目时起作用。但它在创建项目exe文件后停止工作。我的代码如下 static { try { Bridge.setVerbose(true); try { Bridge.init(); } catch (IOException e) { e.printStackTrace(); } Fil

我从dll文件中调用display方法,这在我运行java项目时起作用。但它在创建项目exe文件后停止工作。我的代码如下

static {

    try {
        Bridge.setVerbose(true);
        try {
            Bridge.init();
        } catch (IOException e) {
                  e.printStackTrace();
        }
         File dll_File = new File("helloworld.j4n.dll");
        Bridge.LoadAndRegisterAssemblyFrom(dll_File);

         helloworld.Hello.display(str)


    } catch (Exception exception) {

          exception.printStackTrace();
    }

}

你在dll上签名了吗?请签署dll,然后检查。

helloworld.Hello.display(str)此方法位于Jar文件@ClrMethod(value=“(LSystem/String;)Z”)中的公共静态本机布尔显示(String String);不,我没有签署dllOk,我将检查iTunes,使用链接签署dll。错误显示无法启动JVM