从 java applet 检查程序是否安装在 Linux 机器上

发布于 2024-11-04 10:09:37 字数 673 浏览 1 评论 0原文

您好,我需要能够检查客户端计算机上是否安装了某个软件以及安装在何处,以便启动它。我找到了以下三篇关于如何在 Windows 和 Mac 上执行此操作的帖子,但我似乎无法弄清楚 Linux 上的操作,因为没有注册表。有谁知道如何在 Linux 上做到这一点?

适用于 Windows 和 Mac 的类似帖子:
可以Java 小程序打开“选择目录”并通过 JavaScript 交互写入文件系统?
使用 Java 读取/写入 Windows 注册表
如何我看到使用 java 应用程序在 Mac 操作系统中安装的软件?

任何帮助将不胜感激:)

Hi I need to be able to check if a certain software is installed on the clients computer and where, in order to launch it. I found the following three posts as to how to do so on Windows and Mac but I can't seem to figure it out for Linux as there is no registry. Does any one know how this can be done on Linux?

Similar posts for Windows and Mac:
Can a Java applet open a "select directory" and write to a filesystem via JavaScript interaction?
read/write to Windows Registry using Java
How can I see the software installed in a Mac OS using a java application?

any help would be greatly appreciated :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

戏舞 2024-11-11 10:09:37

假设您的安全上下文允许,您可以调用 which

$ which java
/usr/bin/java

如果找不到该程序,which 将不输出任何内容。

Assuming your security context allows it, you could call out to which.

$ which java
/usr/bin/java

which will output nothing if the program is not found.

惟欲睡 2024-11-11 10:09:37

使用

which file

命令查看该路径下是否安装了该软件。如果没有出现任何结果,那么您可以执行“

find ./ -name "file"

同时检查其本地 bin 或 .bin(如果它不包含在路径中)”。

Use the

which file

command to find out if the software is installed in the path. If that comes up with nothing then you could do a

find ./ -name "file"

Also check their local bin or .bin if its not included in the path.

三生池水覆流年 2024-11-11 10:09:37

嗯,基本上 Linux 上安装的每个二进制文件都在 PATH(环境变量)中,所以如果你能在那里找到它,它就在那里。

也可能有软件安装到其他路径,但在这种情况下,用户需要指出它们。将应用程序放在单独的路径中并且将其添加到 PATH 中的情况非常罕见。

Well, basically every binary installed on Linux is in the PATH (environment variable), so if you can find it there, it's there.

There may also be software that installs into other paths, but in this case the user would need to point them out. It is a very uncommon case to have an application in a seperate path and not adding that one to PATH.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文