oracle-java
oracle-java copied to clipboard
JAVA_HOME env not set
this playbook do not set JAVA_HOME environment variables.
- 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
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 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