JAVA_HOME variable

I am getting an error while generating Android build because one of libraries we are using try to use JAVA_HOME variable. The error message indicated that this variable didnt exist in the OS.
After downloading and executing the docker image we concluded that it is in fact not set.

As we cant change the library source, we tried to add this enviroment variable in the workflow but unsuccessfully.

Is there anyway I can set this Enviroment Variable by the workflow?

1 Like

How did you try to add it?

Adding it as an App Env Var should work - those are set as global environment variables (applied/exposed for every Workflow / every build).

Many thanks Viktor, it did work. I was adding variable using “Manage env. vars” button.

I am getting another error now but it is unrelated with that. I will work on that.

Thank you.

1 Like

I’m glad to hear it worked :wink:

Just one note: Manage env vars should also work if that step is in that workflow.

The UI is not clear, will be fixed in the upcoming new Workflow Editor (Workflow Editor “v2” (Open Source & Offline Workflow Editor)). Manage Env Vars right now sets env vars for only the selected workflow. Those env vars won’t be available in other workflows (unless chained as an after workflow), App Env Vars are exposed for all workflows (related docs: http://devcenter.bitrise.io/bitrise-cli/most-important-concepts/#availability-order-of-environment-variables).