Java : dll 之间的切换取决于系统架构 (32/64) [英] Java : switching between dll depends on system architecture (32/64)

查看:37
本文介绍了Java : dll 之间的切换取决于系统架构 (32/64)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Java 程序使用了一些 dll.由于必须为特定的系统架构(32 位或 64 位)构建这些嵌入的 dll,我想制作一种方法/东西,允许我的程序在 32/64 位版本的 dll 之间切换(或者如果程序运行,则禁用库加载在 64 位系统上)

I have a Java program uses some dlls. As these embeded dlls have to be built for a specific system architecture (32 or 64bits) I want to make a method/something that allow my program to switch between 32/64 bits version of dlls (or disable the library load if the program run on a 64 bits system)

我希望有一个不同于制作两个版本程序的解决方案

I hope there is a solution different from making two versions of the program

提前致谢,达米安

推荐答案

使用系统属性:

if ("x86".equals(System.getProperty("os.arch"))) {
   // 32 bit
} else if ("x64".equals(System.getProperty("os.arch"))) {
   // 64 bit
}

这篇关于Java : dll 之间的切换取决于系统架构 (32/64)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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