environment-variables

Running a command with specific environment settings - one-liner

To run a program with custom env settings, we do this on Linux $ MYVAR=23 ./foo.py On Windows, the only way I know of is: C:\> set MYVAR=23 C:\> .\foo.py C:\> REM unset MYVAR here (but how?) But can't this done be as an one-liner? ...

Apache SetEnvIf trouble

I have the following in my .htaccess file: SetEnvIf Host "^example\.com$" myvar=1 <IfDefine myvar> RewriteRule ^(.*)$ index2.php?q=$1 [L,QSA] </IfDefine> As far as I can tell, this should be working properly. However, "myvar" does not appear to get defined when I visit from example.com. I know that I have the mod_setenvif.c enable...

Eclipse fails to start via an application launcher

Hi everybody. The problem: elcipse-3.5.0 (Galileo) spits with an error when I try to launch it by clicking its launcher. The curse sound like this: A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following location...

Compiling Error On BlackBerry

Hi Friends I have done simple java app for blackberry, while building am getting following error. "Building Hisantosh C:\BlackBerryJDE4.5.0\bin\rapc.exe -quiet import=..\lib\net_rim_api.jar codename=Hisantosh Hisantosh.rapc warnkey=0x52424200;0x52525400;0x52435200 "C:\Documents and Settings\Santosh\My Documents\Downloads\greetingscree...

On a Mac, within the shell, how can I tell that I have a GUI?

Because you (lovely) people are always so curious about posters' original intents, here's mine: If I'm on a Mac and have a GUI (as opposed to, say, being on an ssh session), I want to set my $EDITOR to mate_wait. (And go with vim otherwise.) And, you have an answer for that. I do too. It even works. Here. Sometimes. So I want you...

Referencing Environment Variables in web.xml

I'm pre-packaging a JSP web-app that relies on some file path settings found within web.xml. These settings are unknown at packaging time, because they reference a path the customer will set when deploying the entire application (of which the web-app is a management interface). It seems that the easiest way to avoid tokens and file mod...

Bash - $PATH and ${PATH}

What is the difference between using an environment variable, like PATH, as $PATH or ${PATH}? ...

System environment variable created during install not available to current user until reboot

I have a msi package generated by wix that creates a system environment variable by populating the Environment table. <Environment Id="CreateEnvVar" Name="DATADIR" Action="set" System="yes" Part="all" Value="[DATA_DIR]" /> The install successfully creates the environment variable at the system level. This was verified by view...

How do I find a file that may not be fully-qualified by using the environment path?

I have an executable name, like "cmd.exe" and need to resolve it's fully-qualified path. I know the exe appears in one of the directories listed in the PATH environment variable. Is there a way to resolve the full path without parsing and testing each directory in the PATH variable? basically I don't want to do this: foreach (string ...

Variables that persist across .pro files from a subdirs pro file

Greetings, I've got a .pro file that looks like: TEMPLATE = subdirs SUBDIRS = foo bar I want to set a variable, or define, or something in my subdirs .pro file that can be read in both the foo and bar .pro files. I've tried to set an environment variable with: export TEST=something but that does not work, message($$(TEST)) always...

C Programming. Printing current user

In C programming how do you get the current user and the current working directory. I'm trying to print something like this: asmith@mycomputer:~/Desktop/testProgram:$ (user) (computerName) (current directory) I have the following code, but the username is showing as NULL. Any ideas what I'm doing wrong? void prompt() { pr...

Passing environment variables to a JVM, in a platform-independent manner

I'm developing a J2EE application that runs in JBoss on a Windows Vista machine, but the application will end up on a Linux machine. Is there a way to pass in the value of an environment variable in a platform independent way? I think (but I'm not sure) the platform-sensitive way would be: -Denv_var=%MY_ENV_VAR% (Windows) -Denv_var=$MY...

Refresh $env:path in Powershell?

I have a PowerShell script that checks that a certain directory is on the PATH (by looking through $env:path). It appears that $env:path is loaded and locally scoped by each application on startup, and that scope is passed on to any child applications. So... if someone opens Firefox, downloads my program, runs it, gets a message that t...

In Powershell how do I set a temporary environment avariable from a variable $var?

Typically, in Powershell you would use env:VARIABLE = "Some kind of value" But my issue is that I have the name of the variable in a string object. Powershell does not recognize it as a string object and uses the variable name as the name of the environment variable. For example, if I do this: $someVariable = "MY_ENV_VAR" env:$some...

MSBuild required enviroment variables

I'm trying to setup .NET (C#) build from command line. Can someone just give me a list of environment variables that I need to set up in the MSDOS prompt before I can run MSBuild.exe from the command line. The path to MSBuild executable would be the most obvious example. I cannot rely on setting variables from MyComputer->Properties->Adv...

How to set user environment variables in Windows Server 2008 R2 as a normal user?

In older versions of Windows, it was just open the Control Panel, select the System applet, select the Advanced tab, and then hit the Environment variables button. As a normal user, you could edit the "User variables" but not the "System variables". In Windows Server 2008 R2, if I try to hit the Advanced System settings option in the S...

Service Not Able to See Environment Variable

I created an installer (via WiX) that, as part of the installation, installs a Windows service (written in C#), and starts that Windows service. The service is a FileSystemWatcher and watches for the installation of plug-ins to a specific directory. Originally, it used an environment variable (which pointed to the path I wanted to watc...

Why doesn't os.system('set foo=bar') work?

Possibly a stupid question: Why can't I set an environment variable with this? os.system('set foo=bar') # on windows I'm aware of os.environ, and that works for me. I'm just confused about why the former doesn't work. ...

Why am i not able to link my C/C++ libraries with NetBeans?

I've downloaded C/C++ libraries from Cygwin, and set the environment variables according to the instructions here, in NetBeans. I've also gone through this. Actually I followed the same steps on a different machine and everything worked out fine. But on my machine the associations aren't made. for example: #include<stdio.h> says No suc...

Why aren't a batch file's environment variables set when run from Perl?

I am trying to invoke a bat file from a perl script as follows: system("call D:/SIP/run_$file_idx.bat"); However I observe that the environment variables in the bat fail to get resolved. If I run the bat file separately from the command prompt it works. Does system() create a new environment and execute bat file in that? What is th...