Here is what use to use. You can the code below as an .xml file and import it into Lansweeper. This was my update deployment, but it will work for installing as well. This is for an older version, so you may have to make some changes to the the file path in step 1. This will also remove older versions I'm Java that are installed in install the latest version. You will need to download the latest Java install and put it in the fall share on your Lansweeper server. Also keep in mind that Java recently changed its licensing model.
<?xml version="1.0" encoding="UTF-8"?>
-<Package>
<Name>Update - Java 8.0.261</Name>
<Description/>
<ShutdownOption>0</ShutdownOption>
<ShutdownTime>0</ShutdownTime>
<MaxDuration>900</MaxDuration>
<Rescan>False</Rescan>
<RunMode>1</RunMode>
-<Steps>
-<Step>
<Nr>1</Nr>
<Name>Check to see if Java in installed</Name>
<Type>5</Type>
<ReturnCodes/>
<Success>-2</Success>
<Failure>2</Failure>
<Path/>
<Parameters/>
<MSIParameters/>
<MSIName/>
<MSIVersion/>
<Command/>
<EditMode>False</EditMode>
-<Conditions>
-<Condition>
<Type>1</Type>
<SpecOne>C:\Program Files (x86)\Java\jre1.8.0_261\bin\</SpecOne>
<SpecTwo>javaw.exe</SpecTwo>
<Operator>1</Operator>
<Value/>
</Condition>
</Conditions>
</Step>
-<Step>
<Nr>2</Nr>
<Name>Install Java/Uninstall Old Version</Name>
<Type>1</Type>
<ReturnCodes>0,1641,3010</ReturnCodes>
<Success>-2</Success>
<Failure>-3</Failure>
<Path>{PackageShare}\Installers\jre-8u261-windows-i586.exe</Path>
<Parameters>INSTALL_SILENT=Enable AUTO_UPDATE=0 REBOOT=Disable EULA=Disable REMOVEOUTOFDATEJRES=Enable SPONSORS=Disable</Parameters>
<MSIParameters>/i /qn /norestart</MSIParameters>
<MSIName/>
<MSIVersion/>
<Command>"{PackageShare}\Installers\jre-8u261-windows-i586.exe" INSTALL_SILENT=Enable AUTO_UPDATE=0 REBOOT=Disable EULA=Disable REMOVEOUTOFDATEJRES=Enable SPONSORS=Disable</Command>
<EditMode>False</EditMode>
<Conditions/>
</Step>
</Steps>
<SoftwareVersion>8.1.110.1</SoftwareVersion>
</Package>