Worklet - Java 271

  • 4 November 2020
  • 5 replies

Hey guys, just need some assistance finalising the Java worklet. The automatic patching seems to have uninstalled Java from a fair few machines so need to resolve.

It works fine running from the local machine, however no luck from Automox.

Eval is fine.

It downloads the two files then does not run the commands; installing 2 instances of Java (32 and 64bit).

#Handle Exit Codes:
trap { $host.ui.WriteErrorLine($_.Exception); exit 90 }


$process1 = Start-Process -FilePath 'jre-8u271-windows-i586.exe' -ArgumentList '/s', 'REMOVEOUTOFDATEJRES=1', '/L C:\ProgramData\amagent\worklets\java\java_86.log' -Wait -Passthru -ErrorAction Stop
$process2 = Start-Process -FilePath 'jre-8u271-windows-x64.exe' -ArgumentList '/s', '/L C:\ProgramData\amagent\worklets\java\java_64.log' -Wait -Passthru -ErrorAction Stop
exit 0



$Exception = $error[0].Exception.Message + "`nAt Line " + $error[0].InvocationInfo.ScriptLineNumber
Write-Output $Exception
exit 90

Would appreciate any assistance.

5 replies

Hey there. I haven’t installed JRE in quite a while. With that being said, it looks like there are now 2 installers (exe and msi), and each has a method to define configurations.

EXE appears to prefer a configuration file:

MSI supports additional switches and/or a config file:

As an Automox best practice, I would suggest using an alternate directory for your log file. the amagent directory is the running directory for the Automox agent, and content may not persist through agent actions, or upgrades. There will be cases where this directory permissions are reset by the agent as well.

We just had the same thing happen. Rolled out patches to 2500 computers and for some reason automox decided to uninstall java off a bunch of them. I haven’t figured out why it removed it off some and not others. What a mess it caused with our finance department. I seen an earlier post from Automox saying that Oracle is not longer allowing third parties to patch java 8, but that’s no reason to just remove it.

Hello David_Mitchell and rmullen,

This shouldnt be something Automox would do normally. It does sound like a bug. Have either of you submitted a ticket about this? If not can you submit one to with machine names this happened on?

Thanks Brandon. Yes, opened a ticket and it looks like you were the one to grab it.

Ok I have confirmed this does appear to be a bug on Automox’s side. We are going to work on getting a ticket in for this soon.