久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

檢測某些軟件是否安裝在 Java 中的用戶機器上

Detect if certain software is installed on a user#39;s machine in Java(檢測某些軟件是否安裝在 Java 中的用戶機器上)
本文介紹了檢測某些軟件是否安裝在 Java 中的用戶機器上的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我有一個 Java 應用程序,它需要某些軟件(其中之一是 Perl)才能運行.我用來檢測 Perl 的方法是:

I have a Java application which requires certain software (one of them being Perl) before it can be run. What I used to do to detect for Perl is:

Runtime.getRuntime().exec("perl Test.pl");

如果有 IOException 則聲明沒有 Perl.

and if there was an IOException declare that there was no Perl.

但是,我的一位用戶抱怨該應用程序一直失敗,因為他沒有將 Perl 放在他的路徑變量中.所以這就是我要問的原因:是否有任何跨操作系統的方法來檢測用戶系統上是否安裝了 Perl(或任何其他軟件)以及程序的路徑?

However, one of my users complained that the app kept failing because he had not placed Perl in his path varible. So this is why I'm asking: Is there any cross-operating system way to detect whether Perl (or any other software) is installed on the user's system and the path to the program?

推薦答案

我不知道你的目標受眾(用戶),但失敗時你可以提示用戶輸入路徑(一個 FileChooserDialog)然后存儲這個路徑以備將來使用(如果沒有再次拋出異常).前段時間我這樣做了,幸運的是我的用戶是系統管理員,所以他們可以在第一次發生錯誤時提供該信息(我還記錄了如何在屬性文件中更新或更改這些值).

I don't know your target audience (users), but upon failure you could prompt the user to enter the path (a FileChooserDialog) and then store this path for future usage (if the exception is not thrown again). I did that some time ago, luckily I had users that were SysAdmins, so it was OK for them to provide that info when the error happened the first time (I also documented how to update or change these values in a properties file).

Don 提到的其他選項是安裝相對于您的安裝所需的軟件,這是一個更常見的選項.

Other option as mentioned by Don, is to install the required software as relative to your installation, that's a more common option.

這篇關于檢測某些軟件是否安裝在 Java 中的用戶機器上的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期時間,就像在 UTC 中一樣)
How to convert Gregorian string to Gregorian Calendar?(如何將公歷字符串轉換為公歷?)
Java: What/where are the maximum and minimum values of a GregorianCalendar?(Java:GregorianCalendar 的最大值和最小值是什么/在哪里?)
Calendar to Date conversion for dates before 15 Oct 1582. Gregorian to Julian calendar switch(1582 年 10 月 15 日之前日期的日歷到日期轉換.公歷到儒略歷切換)
java Calendar setFirstDayOfWeek not working(java日歷setFirstDayOfWeek不起作用)
Java: getting current Day of the Week value(Java:獲取當前星期幾的值)
主站蜘蛛池模板: 亚洲欧美一区二区三区国产精品 | 久久综合久久综合久久综合 | 怡红院怡春院一级毛片 | 国产伦精品一区二区三区高清 | 在线精品一区二区三区 | 久久久性 | 最新午夜综合福利视频 | 亚洲精品在线播放 | 久久99国产精一区二区三区 | 91中文字幕在线 | 欧美日韩国产不卡 | 久久精品免费 | 免费视频中文字幕 | 毛片在线视频 | 99精品视频免费在线观看 | 欧美自拍第一页 | 视频一区二区在线观看 | 国产激情免费视频 | 日本成人在线免费视频 | 国产日韩欧美一区 | 欧美freesex黑人又粗又大 | 农村真人裸体丰满少妇毛片 | 欧美性大战久久久久久久蜜臀 | 国产aⅴ| 日韩久久网 | 国产女人第一次做爰毛片 | 国产精品片aa在线观看 | 午夜电影网站 | 国产精品久久久久久吹潮 | 久久一级 | 国产一级淫片免费视频 | 国产中文一区二区三区 | 国产欧美二区 | 国产高清一区二区 | 久久国产婷婷国产香蕉 | 欧美一级全黄 | 黄色毛片黄色毛片 | 日日噜噜噜夜夜爽爽狠狠视频, | 亚洲网站在线观看 | 国内精品久久久久久久影视简单 | 日韩欧美中文字幕在线观看 |