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, it runs as an archive with winrar. All I want to know is how to detect whether java runtime is installed or not on a computer using c# code in order to show a MessageBox telling user to install java runtime, or launches the ".jar" file using the java runtime if it's installed.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- Sorting 3 numbers without branching [closed]
- How to maintain order of key-value in DataFrame sa
- Graphics.DrawImage() - Throws out of memory except
Start 'java -version' in a childprocess. Check exitcode and returned output for versioninfo
You can check the registry
You could check in the registry. This will tell you if you have a JRE, and which version.
From this document:
where the includes the major, minor and the patch version numbers; e.g., 1.4.2_06
A small applet in a html page which cancels a redirect to a "Please install Java" page.
EDIT: This is almost the only really bullet-proof way. Any registry key containing JavaSoft is most likely only for the Sun JVM and not any other (like IBM or BEA).