kensuke1984
kensuke1984

Reputation: 995

Check if Java (or any applications) installed in Windows

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

Answers (1)

Rohan Bari
Rohan Bari

Reputation: 7726

Suppose your program needs to be RUN with Java, it's cleared you meant about JRE.

Default registry for Java Runtime Environment

Just check in the Registry if the CurrentVersion exists as shown. Registry Values

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

Related Questions