Reputation: 995
I want to provide software which runs on Java. For the software I also would like to provide something which allows users to see if their machine already has Java installed.
It should be like this if it is in macOS
#!/bin/sh
command -v java
How can I achieve what I want? what environment should I use? Windows batch ? or..
Upvotes: 1
Views: 151
Reputation: 7726
Suppose your program needs to be RUN with Java, it's cleared you meant about JRE.
Just check in the Registry if the CurrentVersion
exists as shown.
You may use this way to read the Registry (JAVA code): Read/write to Windows registry using Java
If the registry value returns, then JRE installed.
Upvotes: 1