<commit_before>---
- name: check java_home directory
  stat: path={{ java_home }}
  register: java_home_check

- name: check jdk_archive file
  stat: path={{ jdk_archive }}
  register: jdk_archive_check

- name: remove jdk_archive if it exists and it is empty
  file: state=absent path={{ jdk_archive }}
  when: jdk_archive_check.stat.exists and java_home_check.stat.size == 0

- name: download Java
  command: "wget -q -O {{ jdk_archive }} --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' {{ jdk_tarball_url }} creates={{ jdk_archive }}"
  when: java_home_check.stat.exists == False

- name: unpack archive
  unarchive: src={{ jdk_archive }} dest={{ java_install_dir }} copy=no creates={{ java_home }} owner=root group=root

- name: fix ownership
  file: state=directory path={{ java_home }} owner=root group=root recurse=yes

- name: make Java available for system
  command: update-alternatives --install /usr/bin/java java {{ java_home }}/bin/java 18000

- name: run update-alternatives to set the installed java
  command: update-alternatives --set java {{ java_home }}/bin/java

- name: clean up
  file: state=absent path={{ jdk_archive }}<commit_msg>alternatives link for javac<commit_after>---
- name: check java_home directory
  stat: path={{ java_home }}
  register: java_home_check

- name: check jdk_archive file
  stat: path={{ jdk_archive }}
  register: jdk_archive_check

- name: remove jdk_archive if it exists and it is empty
  file: state=absent path={{ jdk_archive }}
  when: jdk_archive_check.stat.exists and java_home_check.stat.size == 0

- name: download Java
  command: "wget -q -O {{ jdk_archive }} --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' {{ jdk_tarball_url }} creates={{ jdk_archive }}"
  when: java_home_check.stat.exists == False

- name: unpack archive
  unarchive: src={{ jdk_archive }} dest={{ java_install_dir }} copy=no creates={{ java_home }} owner=root group=root

- name: fix ownership
  file: state=directory path={{ java_home }} owner=root group=root recurse=yes

- name: make Java available for system
  command: update-alternatives --install /usr/bin/java java {{ java_home }}/bin/java 18000

- name: run update-alternatives to set the installed java
  command: update-alternatives --set java {{ java_home }}/bin/java

- name: make Javac available for system
  command: update-alternatives --install /usr/bin/javac javac {{ java_home }}/bin/javac 18000

- name: run update-alternatives to set the installed javac
  command: update-alternatives --set javac {{ java_home }}/bin/javac

- name: clean up
  file: state=absent path={{ jdk_archive }}
{'fraction_non_alphanumeric': 0.12211466865227104, 'fraction_numerical': 0.006329113924050633, 'mean_word_length': 4.417338709677419, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2542874', 'n_tokens_mistral': 863, 'n_tokens_neox': 858, 'n_words': 261}