Skip to content

Commit

Permalink
Install JDK 17
Browse files Browse the repository at this point in the history
  • Loading branch information
creasty committed Jan 22, 2024
1 parent e94df93 commit 9549e93
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions provisioning/roles/java/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@

- name: install openjdk
homebrew:
name: openjdk
name: openjdk@17
state: latest

- name: tap adoptopenjdk/openjdk
homebrew_tap:
tap: adoptopenjdk/openjdk
state: present

- name: install old versions
homebrew_cask:
name: adoptopenjdk11
state: latest
sudo_password: '{{ ansible_become_pass }}'

- name: check jenv
command: |
bash -lc 'which jenv'
Expand All @@ -37,6 +26,13 @@
src: export_jenv_hook.zsh.patch
dest: '{{ anyenv.envs_dir }}/jenv/plugins/export/etc/jenv.d/init/export_jenv_hook.zsh'

- name: link
file:
src: /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk
dest: /Library/Java/JavaVirtualMachines/openjdk.jdk
state: link
force: yes

- name: register java home
command: |
bash -lc 'jenv add "$(/usr/libexec/java_home)"'
Expand Down

0 comments on commit 9549e93

Please sign in to comment.