Environment variables not updated during deployment

What are we doing:

We do automatic deployment using the Nolio tool. One of the steps we need to take is to set some environment variables for the deployed applications - for example, JAVA_HOME , pointing to our preferred java installation directory.

We use the SET command to constantly set environment variables - and in most cases it works great. If I right-click on my computer and go into environment variables, they all look great.

Problem:

Unfortunately, later in the deployment, command line commands that rely on environment variables are executed, and the environment variables do not seem to be set. Using SET without parameters verifies this by displaying all currently available variables.

Now, if I restart the computer, the command line commands work fine. So the problem is that although the variables are constantly set and displayed in the GUI, they are not passed to the command lines until I reload.

Another interesting tidbit:. If I put the commands in the BAT file and double-click on it, it works fine, but if I run it on the command line, the variables will not be allowed until the reboot.

Does anyone know about this?

+4
source share
3 answers

First, which version of Nolio are you using?

The environment variables in which you set the value in the context of a single Nolio action remain within that action. (It's like opening two different shells with every action)

Best practice for this case would be to use the resources of arrays of arrays of environment variables in the Nolio "Run Command Line" action. You must write two arrays of parallel names and values ​​of Env variables and give them as input to the "Run Command Line" action.

+6
source

It looks like your variables are not in the command line area. At what point in the deployment process do you use the SET command? Interestingly, the GUI recognizes the values, but the command line does not start until you restart.

Also, I don't understand why using a .bat file is undesirable. I can come up with my own reasons, but what's yours?

EDIT

I found this article that shows a step that you were not talking about. You tried:

 rem Set the JAVA_HOME environment variable and insert it into the system path. rem This will make the javac and java commands reachable from the command line. set JAVA_HOME="C:\Program Files\Java\jdk1.5.0_14" set PATH=%JAVA_HOME%\bin;%PATH% 
+2
source

I'm not quite sure why the command line will not recognize commands and batch files, but you can use SETX as an alternative to SET to find out if this fixes your problems.

+1
source

All Articles