Installing Java JRE on windows 2016 core

Hi,

I had problems getting ansible to install java on a windows 2016 server… I started using the 64 bit version and then it worked fine.

Now I am trying to do the same on 2016 server core and it fails with the 64 bit version… was kind of just hoping it would work, but after numerous failures, I am grasping at straws.

It has a fatal error 1603, but that’s about all the info I get back. Ansible gives me that error and I see the same error in the windows application event log. I have of course googled this error and found quite a bit of info, but mostly relating to old versions of java and clean reboots etc. This is a brand spanking new VM, I have tried 3 of them now and get the same error each time.

Its the current version of java, 8u171 .

It would appear that java needs to be installed on server core using a batch file below with config file… So I tried that using win_command and as I have seen in many comments, ansible will not continue until all child processes are finished and I guess this isn’t finishing - java is installed, but ansible does not continue. It sounds like win_shell will have the same problems… any ideas on how I could get this done? I’ve looked at writing a module but don’t think I am quite up to speed to do that yet. Thanks for any ideas or advice.

pushd %~dp0
start /wait jre-8u112-x64.exe INSTALLCFG=%~dp0jre.cfg

Hi

Without actually seeing the server itself I can’t give you much but a quick Google search shows there is some compatibilities with the JRE and JDK resulting in the rc of 1603 https://www.ghacks.net/2015/06/26/fixing-java-update-did-not-complete-error-code-1603/. I’ve only installed the JDK before but the JRE should be similar, you don’t need to use a batch file, something like this should work

`

  • name: template out JRE install config
    win_template:
    src: jre-install.cfg
    dest: jre-install.cfg # better if you used the absolute path here and below

  • name: install Java JRE
    win_command: jre-8u112-x64.exe INSTALLCFG=jre-install.cfg

`

I have no idea with the install.cfg format should be but it needs to at least specify that the installer is run in silent or quiet mode with no prompts or else it will hang forever. Whether that is implicit or needs to be explicit I’m not sure.

Thanks

Jordna

Thank you. The cfg file does specify all that and I did come to try something like you show below and got much larger error messages from ansible that I am trawling through…. Will also try the jdk to see if I get anything different.

Appreciate you looking at it.

Bill

Hi, I was unable to get the JRE to install. I think it has something to do with it trying to register javaWS in the registry with browsers and as this is core there is of course no browser.

I did however get the JDK to install… I used the win_command – but I think I will go back and attempt with win_package again now as I want to try and keep this as clean as possible.

Thanks for your suggesting that the JDK worked for you!

Regards

Bill