如何检测x64 Windows上是否安装了32位Java,只查看文件系统和注册表? [英] How do I detect whether 32-bit Java is installed on x64 Windows, only looking at the filesystem and registry?

查看:291
本文介绍了如何检测x64 Windows上是否安装了32位Java,只查看文件系统和注册表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要确定特定系统是否安装了32位Java。我正在做一个只允许我访问文件系统和注册表的远程查询,因此我无法尝试运行java.exe或运行任何Java代码。

I need to determine whether a particular system has 32-bit Java installed. I'm doing a remote query that only gives me access to the filesystem and registry, so I cannot attempt to run java.exe, or run any Java code.

I还想确保我检测到IBM和Sun Java以及任何其他发行版,这些发行版似乎将文件放在文件系统和注册表中的不同位置。

I also want to make sure I detect both IBM and Sun Java, as well as any other distributions, which seem to put things in different places on the filesystem and in the registry.

我提出的最好的方法是检查C:\ Windows \SysWOW64 \ javaava.exe。这是测试32位Java存在的可靠方法,还是某些版本不会将java.exe放在该文件夹中?

The best I've come up with is to check for C:\Windows\SysWOW64\java.exe. Is this a reliable way to test for the presence of 32-bit Java, or are there certain versions that won't put java.exe in that folder?

更新:我仍在寻找更加健全的答案。为了清楚起见,我无法访问命令提示符。此外,无论发布者是谁,安装了什么版本号,以及用户选择安装它的路径,我都想检测Java。

Update: I'm still looking for a more robust answer to this. Just to be clear, I don't have access to a command prompt. Also, I want to detect Java no matter who the publisher is, what version number is installed, and no matter what path the user chose to install it on.

C:\ Windows \ SysWOW64 \ javaava.exe似乎符合这些要求,但是我希望得到更多知识渊博的人的确认,每个Java安装程序都会确实把那个可执行文件放在那里。

C:\Windows\SysWOW64\java.exe seems to fit these requirements, but I'd love some confirmation from someone more knowledgeable that every Java installer will indeed put that executable there.

推荐答案

我尝试了Oracle和IBM Java的32位和64位安装程序Windows,以及C:\ Windows \ SysWOW64 \ javaava.exe的存在似乎是确定32位Java可用的可靠方法。我还没有测试过这些安装程序的旧版本,但对于最新版本的Java,这至少看起来应该是一种可靠的测试方法。

I tried both the 32-bit and 64-bit installers of both Oracle and IBM Java on Windows, and the presence of C:\Windows\SysWOW64\java.exe seems to be a reliable way to determine that 32-bit Java is available. I haven't tested older versions of these installers, but this at least looks like it should be a reliable way to test, for the most recent versions of Java.

这篇关于如何检测x64 Windows上是否安装了32位Java,只查看文件系统和注册表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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