How to set environmental variables using Ansible

Yes, there is a cleaner way. You can set environment variables per task: tasks: – shell: echo JAVA_HOME is $JAVA_HOME environment: JAVA_HOME: /usr/java/jre1.8.0_51 register: shellout – debug: var=shellout Output: TASK: [shell echo JAVA_HOME is $JAVA_HOME] ********************************** changed: [localhost] TASK: [debug var=shellout] **************************************************** ok: [localhost] => { “var”: { “shellout”: { “changed”: true, “cmd”: “echo JAVA_HOME … Read more

Wrong JAVA_HOME after upgrade to macOS Big Sur v11.0.1

Seems in macOS Big Sur v11.0.1 the behavior of the /usr/libexec/java_home -v … command has changed: it is sensitive to the previously set value of JAVA_HOME environment variable. Exact behavior is not clear, I couldn’t find any documentation on this, but in my experiments it reported the version already set in JAVA_HOME, regardless of the … Read more

Java_home in Maven

No, it’s not wrong. It is pointing to the JRE used by your JDK, which is what it’s supposed to. If you print out JAVA_HOME outside maven, it should print correctly: C:\>echo %JAVA_HOME% C:\Program Files\Java\jdk1.7.0_07 C:\>mvn -version Apache Maven 3.0.4 (r1232337; 2012-01-17 10:44:56+0200) Maven home: C:\APPS\apache-maven-3.0.4\bin\.. Java version: 1.7.0_07, vendor: Oracle Corporation Java home: C:\Program … Read more

File not found.