I don't know why my system is only detecting environment variable of system and not user.
For instance, when I put "C:\Program Files\Java\jdk1.8.0_25\bin" as first environment variable in user environment variable , I was not able to run "javac" command.
But when I pasted it to system variable it started working.
I know about the dependency issues if I would have placed the path in user variable at the end so I put it at the beginning but still it didn't work..
I searched but found no real solution except dependency issue if I put it at the end.
Have you restarted the CMD?
Maybe you have to logoff & logon to refresh the user variables.
It least on my Windows 7 I have the same behavior, new user variable is not available.
Related
i am trying to store my api keys in a variable via the terminal but i am unsure why it is not saving/storing my api keys.
for example, in the terminal when i type the below:
export GMAIL_USERNAME="myname#gmail.com"
then when i type in env i can see the varaibale has been stored:
but when i restart my terminal the variable GMAIL_USERNAME="myname#gmail.com" is no longer there
could one tell me where i am going wrong? all i would like to do is
store in development my api secret keys in a variable. your help would
be much appreciated
While you can persist environment variables by adding them to a script that gets called on shell startup, that approach has a few problems.
The biggest problem is that they are available globally across your shell, and not scoped to a project.
What happens if you have another project, and want to use a different gmail account?
A better solution is using dotenv or direnv and set those environment variables for the current project only.
I'm using a command process in another program that for some odd reason does not have the system32 set in the path environment variable. I can use the %comspec% variable to get the path C:/windows/system32/cmd.exe, but I need to just have the folder by itself.
I am not overly familiar with command prompt programming; is there a way that I can just add the system32 (or equivalent) path programmatically?
What do you mean programmatically? If you're refering to a variable, there is no standard variable for system32. However you could use %WINDIR%\system32 or %systemroot%\system32.
While it appears that there is no environment variable for obtaining the system32 folder (or its equivalent) on a system, I did find a solution involving string manipulation. The following block of code will add the folder where the cmd.exe path is located:
SET str=%ComSpec%
SET str=%str:cmd.exe=%
SET PATH=%PATH%;%str%
It is very nice answer. i have tried and worked out. This problem comes with window7 OS probably.
SET str=%ComSpec%
SET str=%str:cmd.exe=%
SET PATH=%PATH%;%str%
I have a problem assessing my advanced settings of my computer, anytime i get to the properties of my computer it freezes and vanishes, I decided to set my path through the command prompt. Though the lines below works. Its just temporal and the path is unset immediately i close the running command prompt,
set path=%path%;C:\python27
I am just wondering why my computer's property panel vanishes.
Any others ways to set the environment variables permanent?
try using setx PATH "%PATH%;C:\python27"
Note that u need to close the current cmd window, after executing this command as the changes will reflect in newer instances only.
There's clearly something I don't understand about Erlang... well, among many things.
I've set up an application under Rebar called cw.I start it up and everything runs fine.
Now I want to create an environment variable so I can access the src directory. I've entered the following in cw.app.src:
{env, [{proj_root, "mypath/apps/cw"}]}
Compile, start with Rebar start.sh... everything works fine.
Now the mystery. Yesterday when I did this, I got the correct path when I entered application:get_env(cw, proj_root) in the Erlang shell. But today I get undefined.
What am I missing?
Many thanks,
LRP
application:load(cw) should be enough.
Did you forget application:start(cw) first?
If application not started, the env is undefined.
if i change hkey_current_user/environment/path in registry, get-env "PATH" doesn't reflect the new value unless I close rebol console and re_open it.
Environment variables are not the same things as Registry Keys.
Windows does consult particular registry keys when it is setting up the default environment a program gets when it launches from the shell. However, changing it won't inject those values into the environments of already running processes (in Rebol or any other program). Conversely, if you set things in the environment of a running program you won't see those changes reflected back into the registry.
If you want to read registry values, there is an API for that:
http://www.rebol.com/docs/sdk/registry.html
BUT rightly or wrongly: it is generally accepted (on every platform I've used) that one must exit a program and restart it in order to refresh environment variables from system settings. If you try and work around that, you may cause more complexity and confusion than anything else.