Error while installing JAVA on windows using chef

#1

Hi , I've downloaded JAVA cookbook from supermarket to install JAVA on windows through CHEF. I want to install JRE 8 on windows. Now i went into the attributes folder and opened default.rb file and added my exe file path to the "default['java']['windows']['url'] " variable. Now when i am running the cookbook locally i am getting the error saying "bad URI(is not URI?): C:\Softwares\JRE\jre-8u212-windows-x64.exe" . Please help.

case node['platform_family']
when 'windows'
  default['java']['install_flavor'] = 'windows'
  **default['java']['windows']['url'] = 'C:\\Softwares\\JRE\\jre-8u212-windows-x64.exe'**
  default['java']['windows']['checksum'] = nil
  default['java']['windows']['package_name'] = 'Java SE Runtime Environment 8u212'
  default['java']['windows']['public_jre_home'] = nil
  default['java']['windows']['owner'] = 'administrator'
  default['java']['windows']['remove_obsolete'] = false
#2

disclaimer: I don't use chef on windows or this particular cookbook

Looking at the java cookbook on github, it looks like it is actually expecting a remote url: https://github.com/sous-chefs/java/blob/8cbc7708a02fb52507bc73bbfa9ec699d0242cbd/recipes/windows.rb#L62

  remote_file cache_file_path do
    checksum pkg_checksum if pkg_checksum
    source node['java']['windows']['url']
    backup false
    action :create
  end

Checking the remote_file resource https://docs.chef.io/resource_remote_file.html it seems the source can also take a local file using the file:// uri scheme. Based on this I would try setting the attribute to 'file:///C:/Softwares/JRE/jre-8u212-windows-x64.exe' and see if that works.