无法在AMD 64位平台JNI上加载IA 32位.dll [英] Can't load IA 32-bit .dll on a AMD 64-bit platform JNI

查看:238
本文介绍了无法在AMD 64位平台JNI上加载IA 32位.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题:使用JNI处理自生产的DLL。
我已经使用Visual Studio 2013生成DLL,用于64位计算机。我已经检查了Dependency Walker,如果我的DLL是64位,它是。然后我试图在我的Java源(Eclipse版本:Luna服务版本1(4.4.1)Java版本1.7.0_71-b14 64位版本)中使用DLL。



当我运行我的Java程序,我得到errormessage无法加载IA 32位.dll在AMD 64位平台上。

  static 
{
System.loadLibrary(iomemjava);
}

我已经花了2天时间在这个问题中搜索stackoverflow和其他一些论坛。我真的出于想法,可能是错误的。



到目前为止,希望你们和女孩能够帮助
Martin

解决方案

Java使用系统属性 java.library.path 作为查找本机库的路径。启动应用程序时,在命令行上使用 -D 选项定义此属性,并将其指向包含该DLL的目录。例如:

  C:\MyProject> java -Djava.library.path = C:\MyProject\\\
ativelib com.mypackage.MyProgram

其中 C:\MyProject\\\
ativelib
是包含要使用的DLL的目录。


I have a Problem :D im working on a self generated DLL with JNI. I have generated the DLL with Visual Studio 2013, for 64Bit machines. I have already checked with Dependency Walker if my DLL is really 64 Bit, and it is. Then i tried to use the DLL in my Java source (Eclipse Version: Luna Service Release 1 (4.4.1) Java Version 1.7.0_71-b14 64 Bit Version).

When i run my Java Programm i get the errormessage Can't load IA 32-bit .dll on a AMD 64-bit platform in this line.

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

I have already spend 2 days in this problems and searched stackoverflow and some other forums. I'm really out of Ideas what could possibly be wrong.

So far and in the hope you guys and girls can help Martin

解决方案

Java uses the system property java.library.path as the path to find native libraries. When you start your application, define this property on the command line with the -D option and make it point to the directory that contains the DLL. For example:

C:\MyProject> java -Djava.library.path=C:\MyProject\nativelib com.mypackage.MyProgram

where C:\MyProject\nativelib is the directory that contains the DLL you want to use.

这篇关于无法在AMD 64位平台JNI上加载IA 32位.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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