ansiblebit / oracle-java

Ansible role to install Oracle Java 8/11 on Debian and RedHat based distributions.
https://galaxy.ansible.com/ansiblebit/oracle-java/
BSD 3-Clause "New" or "Revised" License
141 stars 84 forks source link

JRE or JRE-server support #52

Open aram535 opened 7 years ago

aram535 commented 7 years ago

Would be great if jre or even better jre-server would be supported. Most of the time JDK is not necessary and you're better off running the smaller executables.

jadbaz commented 5 years ago

I also don't understand why this is not supported. I needed to install JRE only. However, the issue is not with downloading JRE package but only with setting javac alternative (since no javac is found)

I got it working by first specifying JRE variables (eg):

And then after running the role, specifying new alternatives:

- name: set Java version as default
  alternatives:
    name="{{ item.exe }}"
    link="/usr/bin/{{ item.exe }}"
    path="{{ item.path }}/{{ item.exe }}"
  with_items:
    - { path: "{{ oracle_java_home }}/bin", exe: 'java' }
    - { path: "{{ oracle_java_home }}/bin", exe: 'keytool' }
    # - { path: "{{ oracle_java_home }}/bin", exe: 'javac' }
    # - { path: "{{ oracle_java_home }}/bin", exe: 'javadoc' }

I think at some point I should submit a PR for this with a default variable oracle_java_is_jre=false