From e9661bef2ea07fd38e881643d18510d705084017 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Wed, 13 Dec 2023 19:20:37 +0100 Subject: [PATCH] Add note on how to install java on gentoo --- java/install_gentoo.txt | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 java/install_gentoo.txt diff --git a/java/install_gentoo.txt b/java/install_gentoo.txt new file mode 100644 index 0000000..ca2733c --- /dev/null +++ b/java/install_gentoo.txt @@ -0,0 +1,38 @@ +sudo emerge -1 dev-java/java-config + +# NOTE: All of these commands rely on a same-version sdk not previously being installed + +# TODO: Try setting JAVA_PKG_FORCE_VM=openjdk-8, and setting JAVA_HOME manually +sudo rsync -rvP build/install-icedtea8/ /opt/icedtea8 +cat << 'EOF' | sudo tee /usr/share/java-config-2/vm/openjdk-8 > /dev/null +JAVA_HOME=/opt/icedtea8 +PATH="${JAVA_HOME}/bin" +LDPATH= +PROVIDES_TYPE='JDK JRE' +PROVIDES_VERSION=1.8 +GENERATION=2 +EOF +sudo emerge --buildpkg=n -O1 dev-java/openjdk:8 +sudo rm -rf /opt/icedtea8 +sudo emerge dev-java/openjdk:8 + +sudo rsync -rvP build/install-jdk11/ /opt/jdk11 +sudo JAVA_HOME="$(echo /opt/jdk11/jvm/*/)" emerge --buildpkg=n -O1 dev-java/openjdk:11 +sudo rm -rf /opt/jdk11 +sudo emerge dev-java/openjdk:11 + +sudo rsync -rvP build/install-jdk17/ /opt/jdk17 +sudo mkdir -p /var/db/pkg/dev-java/openjdk-bin-17 +echo 17 | sudo tee /var/db/pkg/dev-java/openjdk-bin-17/SLOT > /dev/null +sudo ln -s /opt/jdk17/jvm/*/ /opt/openjdk-bin-17 +sudo emerge --buildpkg=n -O1 dev-java/openjdk:17 +sudo rm -rf /opt/jdk17 /opt/openjdk-bin-17 /var/db/pkg/dev-java/openjdk-bin-17 +sudo emerge dev-java/openjdk:17 + +sudo rsync -rvP build/install-jdk21/ /opt/jdk21 +sudo mkdir -p /var/db/pkg/dev-java/openjdk-bin-21 +echo 21 | sudo tee /var/db/pkg/dev-java/openjdk-bin-21/SLOT > /dev/null +sudo ln -s /opt/jdk21/jvm/*/ /opt/openjdk-bin-21 +sudo emerge --buildpkg=n -O1 dev-java/openjdk:21 +sudo rm -rf /opt/jdk21 /opt/openjdk-bin-21 /var/db/pkg/dev-java/openjdk-bin-21 +sudo emerge dev-java/openjdk:21