Anaplan Connect Import, ERROR: Cannot determine Java version.

jonathan.edwards
Certified Master Anaplanner

Anaplan Connect Import, ERROR: Cannot determine Java version.

Hi!

 

This is my first time using Anaplan connect. I am running a basic authentication to execute an import list action on Windows.

 

Below is my script:

 

@echo off
rem This example loads a source text file and runs an Anaplan import into a module.
rem For details of how to configure this script see doc\Anaplan Connect User Guide.doc
set AnaplanUser="myemail@slalom.com:mypassword"
set WorkspaceId="8a81b08e664b157b0166a7dcefb7597d"
set ModelId="E72AA61272A8496AB1C91B558A2E30AE"
set Operation=-file "EmployeesTest.csv" -put "C:\Users\jonathan.edwards\Documents\EmployeesTest.csv" -import "Employees from EmployeesTest.csv" -execute -output "C:\Users\jonathan.edwards\Documents\My Errors.txt"
rem *** End of settings - Do not edit below this line ***
setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat %Credentials% -workspace %WorkspaceId% -model %ModelId% %Operation%
@echo %Command%
cmd /c %Command%
pause

 

I receive the following error when it runs:

 

.\AnaplanClient.bat -user "myemail@slalom.com:mypassword" -workspace "8a81b08e664b157b0166a7dcefb7597d" -model "E72AA61272A8496AB1C91B558A2E30AE" -file "EmployeesTest.csv" -put "C:\Users\jonathan.edwards\Documents\EmployeesTest.csv" -import "Employees from EmployeesTest.csv" -execute -output "C:\Users\jonathan.edwards\Documents\My Errors.txt"
Absolute path to JAVA 8 executable not provided. Will attempt to figure out path from JAVA_HOME or Windows registry...
JAVA_HOME is not defined, will attempt to fetch value from registry...
Checking Windows Registry for Java Version...
ERROR: Cannot determine Java version.
Press any key to continue . . .

 

After it runs, it does not complete the import. What do I need to do to fix this error? Any help is appreciated.

 

Jonathan

5 REPLIES 5
sean_culligan
Certified Master Anaplanner

Re: Anaplan Connect Import, ERROR: Cannot determine Java version.

Dear Jonathan,

 

I looks like your JAVA_HOME environment variable has not been configured. If you have installed Java already, you may just need to set the variable. If you do a quick google of set java_home environment variable there are plenty of guides available.

 

Kind Regards,

Sean

 

jonathan.edwards
Certified Master Anaplanner

Re: Anaplan Connect Import, ERROR: Cannot determine Java version.

Thank you! This was very easy to do. Here are the instructions I followed for anyone else who is having a similar issue.

https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html
Matthew_Kuo
Certified Master Anaplanner

Re: Anaplan Connect Import, ERROR: Cannot determine Java version.

Thank you.  This solution worked for me too.

 

Best,
Matthew

jnoone
Certified Master Anaplanner

Re: Anaplan Connect Import, ERROR: Cannot determine Java version.

Hi Jonathan - there are two options: you can update the variable definition in the anaplan client (AnaplanClient.bat)  from %JAVA_HOME%  to !JAVA_HOME! in line 42 (screenshot attached) or alternatively set JAVA_HOME="Your Java location" in your environmental variables as mentioned.  

 

The issue is that Anaplan Connect 1.4+ has a hard time finding the correct Java installation location. By setting the location in the script, or modifying the AnaplanClient.bat file, you allow Anaplan Connect v1.4+ to locate the Java installation successfully and complete the script.

 

Hope this helps.

 

Jt

 

 

dsoomar002
Super Contributor

Re: Anaplan Connect Import, ERROR: Cannot determine Java version.

The latest version of Anaplan Connect should have solved for this error. Consider upgrading to the latest verison if you have not already. 

 

For older versions, utilizng Windows, Lines 123-125 in the Anaplan Client.bat are missing 3 zeros. This solved the issue for numerous clients I have worked with back while I was in Anaplan Support.

 

rem Check registry for JDK
:FIND_JAVA_VERSION
echo Checking Windows Registry for Java Version...
for /f "skip=2 tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\Software\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\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