Gradle finds wrong JAVA_HOME even though it’s correctly set

Turns out that the particular Gradle binary I downloaded from the Ubuntu 13.10 repository itself tries to export JAVA_HOME. Thanks to Lucas for suggesting this. /usr/bin/gradle line 70: export JAVA_HOME=/usr/lib/jvm/default-java Commenting this line out solves the problem, and Gradle finds the correct path to the Java binary. If you just download the binary from their … Read more

Using Environment Variables with Vue.js

Vue.js with Webpack If you use vue cli with the Webpack template (default config), you can create and add your environment variables to a .env file. The variables will automatically be accessible under process.env.variableName in your project. Loaded variables are also available to all vue-cli-service commands, plugins and dependencies. You have a few options, this … Read more

How to set ASPNETCORE_ENVIRONMENT to be considered for publishing an ASP.NET Core application

Other than the options mentioned above, there are a couple of other solutions. 1. Command line options using dotnet publish Additionally, we can pass the property EnvironmentName as a command-line option to the dotnet publish command. The following command includes the environment variable as Development in the web.config file. dotnet publish -c Debug -r win-x64 … Read more

setting an environment variable in virtualenv

In case you’re using virtualenvwrapper (I highly recommend doing so), you can define different hooks (preactivate, postactivate, predeactivate, postdeactivate) using the scripts with the same names in $VIRTUAL_ENV/bin/. You need the postactivate hook. $ workon myvenv $ cat $VIRTUAL_ENV/bin/postactivate #!/bin/bash # This hook is run after this virtualenv is activated. export DJANGO_DEBUG=True export S3_KEY=mykey export … Read more

How to test code dependent on environment variables using JUnit?

The library System Lambda has a method withEnvironmentVariable for setting environment variables. import static com.github.stefanbirkner.systemlambda.SystemLambda.*; public void EnvironmentVariablesTest { @Test public void setEnvironmentVariable() { String value = withEnvironmentVariable(“name”, “value”) .execute(() -> System.getenv(“name”)); assertEquals(“value”, value); } } For Java 5 to 7 the library System Rules has a JUnit rule called EnvironmentVariables. import org.junit.contrib.java.lang.system.EnvironmentVariables; public class … Read more

What is the difference between user variables and system variables?

Right-click My Computer and go to Properties->Advanced->Environmental Variables… What’s above are user variables, and below are system variables. The elements are combined when creating the environment for an application. System variables are shared for all users, but user variables are only for your account/profile. If you deleted the system ones by accident, bring up the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)