How to detect whether Java runtime is installed or not

后端 未结 4 565
遇见更好的自我
遇见更好的自我 2021-01-02 06:12

I program windows applications using Java and this builds a \".jar\" file not an \".exe\" file. When a client computer with no java runtime installed opens the \".jar\" file

4条回答
  •  既然无缘
    2021-01-02 06:30

    You can check the registry

    RegistryKey rk = Registry.LocalMachine;
    RegistryKey subKey = rk.OpenSubKey("SOFTWARE\\JavaSoft\\Java Runtime Environment");
    
    string currentVerion = subKey.GetValue("CurrentVersion").ToString();
    

提交回复
热议问题