It looks like this question has been asked many times. I searched but I could not get the answer
I am looking for techniques on how to set environment variables in Windows system using Ant
I have around 10 environment variables that needs to be set before I can start the compile using Ant
I am running on Windows system.
any help would be appreciated
Thank you,
Karthik
There is no way to set environment variables through Ant.
The property task can only be used for getting the value of an already set environment variable.
You would need to call Ant's exec task and pass the command line (for your operating system) to set the value of an environment variable.
Related
I am trying to develop a toolchain for wllvm (whole program LLVM) on bazel 3.7 following the tutorial (link to the tutorial). A problem I have is I have to pass an environment variable (LLVM_COMPILER) to wllvm. Can you possibly provide more details here or a concrete example? Is it possible to directly configure the environment variable in .bazelrc?
Thanks a lot!
If it is ok to set an environment variable for each Bazel action, then use --action-env flag
# .bazelrc
build --action_env=LLVM_COMPILER=wllvm
I have Rundeck 2.10.6-1 installed on a Ubuntu 16.04.4 LTS server and would like to set environmental variables just for rundeck. Rundeck itself is functioning normally.
I am able to set the environmental variables in /etc/environment for system-wide availability, but I'd like them to be accessible only by the rundeck session. One of them is SQLCMDPASSWORD, a plain text password, utilized by SQLCMD, so I'd like tighter access. We ended up using this approach for PSQL as well.
I have the rundeck $HOME directory identified as /var/lib/rundeck and the $USER name confirmed as 'rundeck'.
I find that adding environmental variables to .bashrc, .bash_profile, or .profile in that directory are not utilized by 'rundeck' as confirmed with a commandline job executing only 'printenv'. When logged in to the server as 'rundeck' I see the variables.
Am I setting these in right place?
So, no, those variables were not set in the correct place. Here's why...
There were some clues in the answers to this question and this question but neither was sufficient. Applications have their environmental variables set in their profile, and for rundeck that would be
$ more /etc/rundeck/profile
Second clue is from the head of that file which, loosely quoted, indicates
NOTE: DO NOT MODIFY THIS FILE. It will be replaced when the package is upgraded and your changes will not be saved. To override variables in this file, you can instead create a file at: /etc/default/rundeckd
So, I created that default file and set my environmental variables by adding the following content
export SQLCMDUSER=batman
export SQLCMDPASSWORD='secret_bat_password'
Now it works as intended.
I am using Yocto, when i run command env, i could see couple of variables have been set. But when I open up /etc/environment, those variable is not in there.
When i set variable in /etc/environment, for example, proxies, it is not reflected to my system.
How can I know where's the environment variable file?
Thank you.
Yocto environment is set by executing oe-init-build-env script. You can add bitbake variables in local.conf file.
I have a little problem.
I source a script which changes my RedHat environment (PATH, LD_LIBRARY_PATH, etc.i).
When I launch my install with scons, it charges the default Environment from my machine, but not the current that I loaded...
I tried several attempts, but it was not conclusive. Most of the answer on the net are relative to a change on one variable which have to be set in the SConstruct.
How can I tell scons to charge the current Environment, but not the default ?
Thanks in advance !
The SCons way would be to set these environment variables in your SConstruct/SConscripts so that every user would end up with a reproducible build environment.
Take a read of the FAQ for this: http://scons.org/faq.html#Why_doesn.27t_SCons_find_my_compiler.2BAC8-linker.2BAC8-etc..3F_I_can_execute_it_just_fine_from_the_command_line.
SCons does not automatically propagate the external environment used to execute 'scons' to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time scons is invoked. This also means that if the compiler or other commands that you want to use to build your target files are not in standard system locations, SCons will not find them unless you explicitly set the PATH to include those locations.
Already found the solution after some more search : env = Environment(ENV = os.environ)
I see that $JAVA_HOME is a built-in variable in IzPack. Can I assign to it in a pre-install script and have the installer use that? Currently I am stuck on a machine that defaults to an open-source JRE that runs horribly and I need to reassign it to the Sun JRE so that the installer will run properly.
In the pre-install script, can I append to the $PATH with:
${ENV[PATH]} = ${ENV[PATH]}:/usr/local/java/bin
Let me know what I can do, I cannot get access to write to the .cshrc or .cshrc.login and I cannot tell my users to set the environment variables themselves.
The answer to this for me was that I had to write a python script that set the environment variables and then called a subprocess to launch the installer. This is far from ideal, but it seems like if your machine is stuck by default with an open source JRE, then you can't fix that any other way.