Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAVA_HOME env not set #104

Open
jasstionzyf opened this issue Nov 19, 2018 · 3 comments
Open

JAVA_HOME env not set #104

jasstionzyf opened this issue Nov 19, 2018 · 3 comments
Labels

Comments

@jasstionzyf
Copy link

this playbook do not set JAVA_HOME environment variables.

@jasstionzyf
Copy link
Author

jasstionzyf commented Nov 19, 2018

  • 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

@steenzout
Copy link
Member

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?

@jasstionzyf
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants