I'm trying to execute a batch file "spoon.bat" from PENTAHO (pdi-ce-7.1.0.0-12), but there is an error.
Part of batch file where the error is found:
if "%SPOON_CONSOLE%"=="1" set PENTAHO_JAVA=C:\Program Files (x86)\Java\jre1.8.0_121\bin\java.exe
if not "%SPOON_CONSOLE%"=="1" set PENTAHO_JAVA=C:\Program Files (x86)\Java\jre1.8.0_121\bin\javaw.exe
set IS64BITJAVA=0
call "%~dp0set-pentaho-env.bat"
But I receive next below error:
The system cannot find the path specified
The error is when I'm trying to assign the path where java.exe or javaw.exe are found to "PENTAHO_JAVA".
I've modified the path with double quote mark, but doesn't work; and also I've modified as:
if "%SPOON_CONSOLE%"=="1" set "PENTAHO_JAVA=C:\<Program Files (x86)>\Java\jre1.8.0_121\bin\java.exe"
Any idea to how declare it to fix it?
Generally, don't modify the shell scripts coming with Kettle. You're supposed to set certain environment variables to adapt the scripts to your runtime environment. Look at the top comment section in script
set-pentaho-env
to learn what's best for your system.BTW: The current Java 8 security baseline 8u131 was released in April 2017 - you're way behind that. Also, are you aware of the fact that you are using a 32bit JVM with limited RAM support?
Where is the environment variable
PENTAHO_JAVA
referenced?It must be referenced with
"%PENTAHO_JAVA%"
because the string assigned to this environment variable contains characters like a space or&()[]{}^=;!'+,`~
. This is explained in help of Windows command interpreter output on running in a command prompt windowcmd /?
in last paragraph on last help page.It is of course also possible to define the environment variable with the necessary double quotes already added, i.e. use:
But this is not recommended. Better would be to use
and reference environment variable
PENTAHO_JAVA
enclosed in double quotes where it is necessary to specify its value enclosed in double quotes.Example:
For understanding the used commands and how they work, open a command prompt window, execute there the following commands, and read entirely all help pages displayed for each command very carefully.
call /?
echo /?
for /?
goto /?
if /?
pause /?
reg /?
reg query /?
rem /?
Read also the Microsoft article about Using Command Redirection Operators for an explanation of
2>nul
whereby redirection operator must be escaped in this batch code on FOR command line with caret character^
. And read answer on Single line with multiple commands using Windows batch file for an explanation of&
operator.