oracle-java icon indicating copy to clipboard operation
oracle-java copied to clipboard

JAVA_HOME env not set

Open jasstionzyf opened this issue 5 years ago • 3 comments

this playbook do not set JAVA_HOME environment variables.

jasstionzyf avatar Nov 19 '18 00:11 jasstionzyf

  • name: create jdk env variable on /etc/profile.d/ template: src=jdk.sh.j2 dest=/etc/profile.d/jdk.sh become: yes become_user: root
  • name: Execute the command in remote shell; stdout goes to the specified file on the remote. shell: bash /etc/profile.d/jdk.sh >> somelog.txt become: yes become_user: root

jdk.sh.j2: export JAVA_HOME={{ oracle_java_home }} export PATH=$JAVA_HOME/bin:$PATH above scripts resolve this issues

jasstionzyf avatar Nov 19 '18 00:11 jasstionzyf

What if I want to install multiple versions of java on the same server? What should the value be?

Do you want to provide a PR to this repo updating the README.md playbook examples for your solution and, this way, get credit for it?

steenzout avatar Nov 24 '18 07:11 steenzout

@steenzout you are right, if you want to use multi versions of java , this change do not meet it, it works only assumed that just need one version of java. i am glad to provide a PR recently recently

jasstionzyf avatar Nov 27 '18 08:11 jasstionzyf