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

JRE or JRE-server support

Open aram535 opened this issue 8 years ago • 1 comments

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.

aram535 avatar Jun 23 '17 12:06 aram535

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):

  • oracle_java_rpm_filename: 'jre-8u191-linux-x64.rpm'
  • oracle_java_rpm_url: 'https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jre-8u191-linux-x64.rpm'

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

jadbaz avatar Jan 31 '19 15:01 jadbaz