开发者

Check if Tomcat and MySQL are already installed on machine

开发者 https://www.devze.com 2023-04-07 18:50 出处:网络
How can I check using Java if Tomcat and MySQL are already installed on machine? If it is installed I开发者_Go百科 have to disable those options in my installer.If Tomcat is installed as a service on

How can I check using Java if Tomcat and MySQL are already installed on machine? If it is installed I开发者_Go百科 have to disable those options in my installer.


If Tomcat is installed as a service on Windows, you can check the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Tomcat\[version]\InstallPath.

To read the registry from Java, you would need to use something like JNA, the methods Advapi32Util.registryGetKeys() and Advapi32Util.registryGetStringValue() can help.

0

精彩评论

暂无评论...
验证码 换一张
取 消