Anaplan Connect 1.4.X JAVA HOME Variable

Options
paresh_kerai2
paresh_kerai2 Member, ALL USERS, Partner, Certified Master Anaplanner, Certified Model Builder, Community Pioneer Posts: 2 Master Anaplanner of the Year

In the latest versions of Anaplan Connect you are told to set the JAVA HOME Environment Variable. However this then hard codes it to a specific version of JAVA, so if you update Java, the revision changes and Anaplan connect may stop working.

 

I was wondering why AnaplanClient.bat could not just determine this correctly from the registry keys, as it tries to do this.

I found that there are 3 commands in the script (half way done), where it should say equ "0" instead of equ "". I raised this with support and they had already identified that bug. By putting in the fixes below, it should save you the step of setting the JAVA environment variable.

 

if "!CurVer!" equ "0" for /f "skip=2 tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft\Java Runtime Environment" /v CurrentVersion 2^>nul') do set CurVer=%%b
if "!CurVer!" equ "0" for /f "skip=2 tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Development Kit" /v CurrentVersion 2^>nul') do set CurVer=%%b
if "!CurVer!" equ "0" for /f "skip=2 tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft\Java Development Kit" /v CurrentVersion 2^>nul') do set CurVer=%%b
goto :eof