diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2021-08-08 14:27:09 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2021-08-08 14:27:09 +0200 |
commit | ab301575cf06a5f3ccb84828a44240ea906b0496 (patch) | |
tree | 46163e8d0d058a75c62842f26dbf23d7b20907d2 /build-support/java15-openjdk/install_jre-openjdk.sh | |
parent | 0918b059c23f2a09506f83c532c7e0f5dc854f73 (diff) | |
download | packages-ab301575cf06a5f3ccb84828a44240ea906b0496.tar.xz |
added java15-openjdk to build-support
Diffstat (limited to 'build-support/java15-openjdk/install_jre-openjdk.sh')
-rw-r--r-- | build-support/java15-openjdk/install_jre-openjdk.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/build-support/java15-openjdk/install_jre-openjdk.sh b/build-support/java15-openjdk/install_jre-openjdk.sh new file mode 100644 index 00000000..c55c4aef --- /dev/null +++ b/build-support/java15-openjdk/install_jre-openjdk.sh @@ -0,0 +1,35 @@ +THIS_JRE='java-15-openjdk' + +fix_default() { + if [ ! -x /usr/bin/java ]; then + /usr/bin/archlinux-java unset + echo "" + else + /usr/bin/archlinux-java get + fi +} + +post_install() { + default=$(fix_default) + case ${default} in + "") + /usr/bin/archlinux-java set ${THIS_JRE} + ;; + ${THIS_JRE}) + # Nothing + ;; + *) + echo "Default Java environment is already set to '${default}'" + echo "See 'archlinux-java help' to change it" + ;; + esac + + echo "when you use a non-reparenting window manager," + echo "set _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh" +} + +post_upgrade() { + if [ -z "$(fix_default)" ]; then + /usr/bin/archlinux-java set ${THIS_JRE} + fi +} |