[yocto] Environment Variables being unset by bitbake?

Nicolas Dechesne nicolas.dechesne at linaro.org
Thu Jul 10 06:58:43 PDT 2014


On Thu, Jul 10, 2014 at 3:46 PM, Allen Kennedy Jr.
<allen at kennedystuff.com> wrote:
> All with no joy.  I did a bit of google-fu and came up with this one:
> on the command line: BB_ENV_EXTRAWHITE="JAVA_HOME" bitbake myRecipe

the manual says "You must set this variable in the external
environment in order for it to work.", so you really need to set it
before calling bitbake, not in the recipe.

>
> Which almost works, but not really.  my bbnote in my recipe exclaims: NOTE:
> java is here: /usr/local/java/jdk
> which is right, but then in the shell script that gets called after that,
> the first lines are:
> if [ -z "$JAVA_HOME" ]; then
>     echo "JAVA_HOME is not set"
>     exit 1
> fi
>
> Which turns out the error that JAVA_HOME is not set.
>
> again, this shell script works perfectly fine outside of the bitbake system.

you need to explicitely export the bitbake variable for the shell. in
your recipe:
export JAVA_HOME="${JAVA_HOME}"



More information about the yocto mailing list