environment

Running ant through eclipse it doesn't find environment variables, but running ant through terminal is fine

混江龙づ霸主 提交于 2019-12-04 06:41:13
When i run ant through Eclipse some targets build fine, but ones that need a specific environment variable i.e. SOME_SDK that i set in my .profile file won't work. Even if i try to echo out ${env.JAVA_HOME}, Ant through eclipse will just print out that string. But if i run ant through the terminal (i.e. ant sometarget), it will find JAVA_HOME and SOME_SDK and echo those paths out. Ive checked eclipse that it's pointing to the same ant that is in my environment path (/usr/share/java/ant-1.8.1). Any ideas? Thanks When you open a terminal, the environment variables in your .profile get loaded.

restore PATH under Mac OS X [duplicate]

懵懂的女人 提交于 2019-12-04 06:35:53
问题 This question already has an answer here : How to restore .bash_profile on a mac? None of my unix terminal are working [closed] (1 answer) Closed 3 years ago . Hi guys I tried to add new directory to the PATH, but instead appending I overwrote it. Is there any way to restore those default paths? 回答1: If you changed your PATH in a Terminal shell, simply close that Terminal window and open a new one. Changes to environment variables are local to the shell in which you change them (and any

In R6RS Scheme, is there a way to get the current environment for use with eval?

我怕爱的太早我们不能终老 提交于 2019-12-04 05:35:01
Is there any way in R6RS Scheme to obtain the current environment and then pass it as the second argument to eval ? For example, what should the question marks be for the following expression to return 9? (let ((x 4) (y 5)) (eval '(+ x y) ???)) No, there is no such thing in R6RS. Some rare implementations might support something like that, but in the overwhelming majority (including eval in other languages!) this cannot be done. The reason for that is simple: it breaks compilation, since it leads to making two functions distinguishable based on local names, and in some cases can also prohibit

Why do variable lookups in the body of function A take values from the global environment but not function B that calls A?

谁说我不能喝 提交于 2019-12-04 05:22:59
I defined a function: .get <- function( o, ...) { p <- match.call( expand.dots = 0)$... cat( sprintf( 'In .get, it is %s.\n', eval( tail( p, 1)[[ 1]]))) fn <- switch( typeof( o), list =, environment = `[[`, 'S4' = '@', `[`) if( length( p)) eval( as.call( c( fn, quote( o), p))) else o # Here when true, I compose a call based on p. } Then I tried it as follows: it <- 1 m <- matrix( seq( 9), 3) sapply( seq( 3), function( it) { cat( sprintf( 'In sapply, it is: %s.\n', it)) .get( m, , it) }) sapply( seq( 3), function( it) .get( m, , it)) The output: In sapply, it is: 1. In .get, it is 1. In sapply,

How does the JVM determine the (default?) character encoding for argv on Linux

你说的曾经没有我的故事 提交于 2019-12-04 05:14:45
问题 Java has a default character encoding, which it uses in contexts where a character encoding is not explicitly supplied. The documentation for how it chooses that encoding is vague: The default charset is determined during virtual-machine startup and typically depends upon the locale and charset of the underlying operating system. That documentation has to be vague because the method the JVM uses is system specific. Using the default character encoding is often a bad idea; it is better to use

Is there any way to trace through the execution of a batch file?

◇◆丶佛笑我妖孽 提交于 2019-12-04 03:07:48
问题 I inherited some large batch files, and I'd like to rewrite them to a more "developer friendly" language. I'd like to find out the following things: what other scripts it calls what other processes it starts what files does it write to what environment variables it uses, which ones does it set For the last point, I'm aware I can do this before I start: set > original_environment.txt And after I run it, I can do this: set > new_environment.txt and just do a diff between them ... but I'll

How to manage two pip versions in conda?

冷暖自知 提交于 2019-12-04 02:55:55
I am working with conda in Windows. I accidentally installed two versions of pip using python -m pip install --upgrade pip Now when I run conda list from the base env: While pip -version gives pip 10.0.0 If I create a new env with conda create --name py3 pip and run pip --version I get an ImportError, however python -m pip --version works: How can I resolve this? First of all I tried to replicate your issue and when I updated pip to 10.0.1 using python -m pip install --upgrade pip , the command pip --version seems to work for me. I suppose it was a bug on version 10.0.0. Now coming to the

How to enumerate all environment variable in Java

左心房为你撑大大i 提交于 2019-12-03 22:21:53
System.getenv(name) needs the name of environment variable. I am trying to call Runtime.exec(String[], String[], File), the secondary parameter need an array of environment variable, I am not sure whether subprocess will inherit environment variables from current process if I specified this parameter. For example, if I pass new String[]{"NEWDIR=/home"} as secondary parameter and current java process has environment OLDDIR=/var , what is the return value of System.getenv("OLDDIR") in the subprocess? updated: Sorry, I have to use Java 1.4 and it seems that System.getenv() was introduced in 1.5?

Binding outside variables in R

前提是你 提交于 2019-12-03 18:10:55
问题 Suppose I have the following function: g = function(x) x+h Now, if I have in my environment an object named h , I would not have any problem: h = 4 g(2) ## should be 6 Now, I have another function: f = function() { h = 3 g(2) } I would expect: rm(h) f() ## should be 5, isn't it? Instead, I get an error ## Error in g(2) : object 'h' not found I would expect g to be evaluated within the environment of f , so that the h in f will be bound to the h in g, as it was when I executed g within the

Why am I still getting a cannot find Java SE Runtime Environment?

柔情痞子 提交于 2019-12-03 18:02:00
问题 These are the errors I get when I try to run a simple java version in the command window. I followed the advice on Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'?. When I went on regedit, here's what I saw Which meant that there was nothing to change - right runtime version. I then did the next step which was to "delete all previous versions of Java (using "Programs and Features" uninstall process) and then re-install just the version you want to work with"