我有一个 Java 程序使用了一些 dll。由于必须为特定的系统架构(32 位或 64 位)构建这些嵌入式 dll,我想制作一种方法/东西,允许我的程序在 32/64 位版本的 dll 之间切换(或者如果程序运行则禁用库加载在 64 位系统上)
我希望有一个不同于制作两个版本程序的解决方案
提前致谢, 达米安
最佳答案
使用系统属性:
if ("x86".equals(System.getProperty("os.arch"))) {
// 32 bit
} else if ("x64".equals(System.getProperty("os.arch"))) {
// 64 bit
}
关于Java : switching between dll depends on system architecture (32/64),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5379589/