Ansible- how to check jre path on windows machine

Hello everyone,

Need one help,first i need to check jre version path and then compare this jre version with envirommental variable Path (java_home). If env variable is different with jre version path present in system then need to update env variable with new jre version.

FYI- remote machine are windows servers.

Could any one please help me resolve this issue.