1

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..

kensuke1984
  • 949
  • 1
  • 11
  • 21

1 Answers1

1

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.

Rohan Bari
  • 7,482
  • 3
  • 14
  • 34