如何使用.dll文件在java中code文件? [英] how to use .dll files in java code?

查看:311
本文介绍了如何使用.dll文件在java中code文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.dll文件,我已经在Java中使用。这个.dll文件有一个参数化方法,该方法应该返回类型为字符串。 当我传递参数给它,我得到的消息本机方法不指定体内

下面是code ...

 包com.letme.test;

公共类Eagleye_parser {

    字符串n =E48A7 F7759 65EA7;

    公共Eagleye_parser(){}

    静态{
        的System.loadLibrary(Eagleye_parser);
    }

    公共本地字符串eagleye_fmu(N); //这里是给味精:本机方法不指定一个机构
}
 

解决方案

在你项目的简单添加引用。和顶部的空间..那么你就可以访问所有的dll的方法。 如果您使用的是有关Eclispe然后右键点击你的项目 - >然后单击Build path->然后点击后用户库

这是点击添加库

在这里,您可以导入该dll

I have a .dll file, which i have to use in java. This .dll file has a parameterised method, which should return type as string. When i am passing parameter to it, i get the message as Native methods do not specify a body

Here is the Code...

package com.letme.test;

public class Eagleye_parser {

    String n = "E48A7 F7759 65EA7";

    public Eagleye_parser() {}

    static {
        System.loadLibrary("Eagleye_parser");
    }

    public native String eagleye_fmu(n);// here it is giving msg : Native methods do not specify a body 
}

解决方案

Simple add the reference in you project. and the namespace at the top.. then you can access the all dll methods. If your are using Eclispe then right click on your project->Then click on Build path-> then click on Add libraries after that click on user library

Here you can import the dll

这篇关于如何使用.dll文件在java中code文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆