Occasional Contributor

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

3 REPLIES 3
Highlighted
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

 

Highlighted
Occasional Contributor

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
Highlighted
Master Anaplanner/Community Boss

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