java - 在32位浏览器中检测64位jre?

标签 java javascript

有没有办法在 32 位环境中检测 64 位 java 安装? Java 部署工具包没有检测到任何内容,但我想知道是否有某种 secret 浏览器方法可以检测 64 位安装客户端。

最佳答案

Sun's HotSpot JVM FAQ :

When writing Java code, how do I distinguish between 32 and 64-bit operation?

There's no public API that allows you to distinguish between 32 and 64-bit operation. Think of 64-bit as just another platform in the write once, run anywhere tradition. However, if you'd like to write code which is platform specific (shame on you), the system property sun.arch.data.model has the value "32", "64", or "unknown".

您可以像 System.getProperty("sun.arch.data.model") 一样访问它。显然,该属性实际上只能在 Sun JVM/JRE 上设置。

您还可以尝试解析System.getProperty("java.vm.name")的结果,但这也将是高度特定于 vendor 的。

关于java - 在32位浏览器中检测64位jre?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1160448/

相关文章:

javascript - Nodejs SQL 连接和异步模块

javascript - 不知道为什么这个简单的 jQuery AJAX 脚本会在 IE7 中导致错误

javascript - Javascript 中第一行列的 getElementsByTagName

java - 我将如何使用 NSTask 运行 .sh 文件并获取其输出?

java - Graphics Context 只会在一个线程中绘制

java - 使用 URL.openStream() 下载的 HTML 内容始终包含无效字符

javascript - 在 promise 链中访问先前履行的 promise 结果

javascript - 将 PHP 变量传递到 Jquery 弹出窗口

java - 内存使用本地变量而不是内联 Java

java - 从 osgi 包访问资源 : bundle scheme in the URL lead to a malformed exception