environment-variables

How to refresh the environment of a PowerShell session after a Chocolatey install without needing to open a new session

自闭症网瘾萝莉.ら 提交于 2020-05-25 05:58:05
问题 I am writing automated script for cloning GitHub source code to local machine. I failed after installing Git in my script, it asked for close/open powershell. So I am not able to clone code automatic after installing Git. Here is my code: iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) choco install -y git refreshenv Start-Sleep -Seconds 15 git clone --mirror https://${username}:${password}@$hostname/${username}/$Projectname.git D:\GitTemp -q 2>&1

Reading Java system properties from command line

99封情书 提交于 2020-05-24 08:10:50
问题 Is there a better way to print system properties from command line? As we can set the property e.g. java -D<name>=<value> //set a system property Without writing a class to do that? If not possible, why is it not possible/feasible/good to do that from the command line ? 回答1: You can use the -XshowSettings flag in the Hotspot JVM version 1.7 and up (not supported in 1.6): java -XshowSettings:properties -version OpenJDK has had support for this flag since late 2010. Seen in http://marxsoftware

Reading Java system properties from command line

房东的猫 提交于 2020-05-24 08:10:08
问题 Is there a better way to print system properties from command line? As we can set the property e.g. java -D<name>=<value> //set a system property Without writing a class to do that? If not possible, why is it not possible/feasible/good to do that from the command line ? 回答1: You can use the -XshowSettings flag in the Hotspot JVM version 1.7 and up (not supported in 1.6): java -XshowSettings:properties -version OpenJDK has had support for this flag since late 2010. Seen in http://marxsoftware

“Invalid Argument(s): Cannot find executable for null” when emulated Android on VS Code - Mac OS X

匆匆过客 提交于 2020-05-24 03:31:27
问题 When I try to emulate Android on VS Code in Mac OS Catalina after installing Android SDK by Android Studio it returns the message: Invalid Argument(s): Cannot find executable for null. I have already created the environments variables ANDROID_SDK_ROOT and ANDROID_HOME both pointing for the same directory: /Users/anderson/Library/Android/sdk but I have no success. flutter doctor diagnostic: anderson@MacBook-Pro-de-Anderson ~ % flutter doctor Doctor summary (to see all details, run flutter

“Invalid Argument(s): Cannot find executable for null” when emulated Android on VS Code - Mac OS X

孤人 提交于 2020-05-24 03:31:06
问题 When I try to emulate Android on VS Code in Mac OS Catalina after installing Android SDK by Android Studio it returns the message: Invalid Argument(s): Cannot find executable for null. I have already created the environments variables ANDROID_SDK_ROOT and ANDROID_HOME both pointing for the same directory: /Users/anderson/Library/Android/sdk but I have no success. flutter doctor diagnostic: anderson@MacBook-Pro-de-Anderson ~ % flutter doctor Doctor summary (to see all details, run flutter

putenv warning with C++

你。 提交于 2020-05-15 09:06:05
问题 I am trying to use putenv stdlib function in a program that I am compiling with g++ including the flags and warnings -std=c++11 and -Wall -Wextra . The program can be as easy as the following: #include<stdlib.h> #include<iostream> int main(int argc, char *argv[]) { putenv("LD_LIBRARY_PATH=../Desktop/lib"); std::cout<<"hello\n"; return 0; } but I am getting this error warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] . As far as I understood in C++ I should

putenv warning with C++

一个人想着一个人 提交于 2020-05-15 09:04:05
问题 I am trying to use putenv stdlib function in a program that I am compiling with g++ including the flags and warnings -std=c++11 and -Wall -Wextra . The program can be as easy as the following: #include<stdlib.h> #include<iostream> int main(int argc, char *argv[]) { putenv("LD_LIBRARY_PATH=../Desktop/lib"); std::cout<<"hello\n"; return 0; } but I am getting this error warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] . As far as I understood in C++ I should

I am getting '**** WRONG JAVA VERSION ****' on running ant build

耗尽温柔 提交于 2020-05-15 03:47:46
问题 My question is not this question, because I have no discrepancy in java versions. The build on running 'ant clean all' is failing after I installed java 1.8.45 (both jdk and jre). It says: **** WRONG JAVA VERSION **** Environment check failed: You are using a not supported version of Java. Please make sure you are using Java version 1.7 or later. Your current Java version is: 1.8.0_45 TIP: If you are using eclipse you can configure a different JVM under Preferences->Java->Installed JREs.

How to use env .bashrc variables on crontab?

半腔热情 提交于 2020-05-14 09:07:17
问题 I need to send a personal env variable $FTP111_PASSWD defined at my personal .bashrc to crontab execution. How to set an environment variable on crontab? My original shell script, named cron4_etc.sh , created for crontab execution was: #!/bin/bash cd /myFolder/ ftp -n -i <<EOF open 101.111.111.111 user myUser "$FTP111_PASSWD" mget check_*.log bye EOF If I execute the script via terminal ./cron4_etc.sh it is executing fine, but if I have start it using the following crontab line */20 * * * *

Node process.env.VARIABLE_NAME returning undefined

纵饮孤独 提交于 2020-05-11 03:48:27
问题 I'm using environment variables on my mac to store some sensitive credentials, and trying to access them through Node. I added them into my environment profile with export VARIABLE_NAME=mySensitiveInfo When I use echo $VARIABLE_NAME I receive the correct output (my sensitive info). However, when I am trying to access this same variable in Node with process.env.VARIABLE_NAME and try to print it out on the console, I get an undefined. Other environment variables appear to be okay though. For