& chmod +x /usr/local/bin/docker-java-homeĮxport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64Įxport JAVA_DEBIAN_VERSION=8u252-b09-1~deb9u1Įxport CA_CERTIFICATES_JAVA_VERSION=20170929~deb9u3Ĭa-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \ # based on whether the JDK or only the JRE is installedĮcho 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"' \ # add a simple script that can auto-detect the appropriate JAVA_HOME value This is my script which I use to install OpenJDK 8 on Bitbucket's Pipelines Docker image NodeJS 10.16.2.īut now I see that this docker image is based on Stretch.Īpt-get update & apt-get install -y -no-install-recommends \Įcho 'deb stretch/updates main' >/etc/apt//jessie-backports.list Just waste few seconds on them (or continue with man 1 update-alternatives). Look at new symbolic links: ls -la /etc/alternatives | grep java-8 (I also have 90-debian-testing.list file for the testing repo.)Īnd check you system wont update from unstable sources: apt list -upgradableĪnd recheck is required package can be installed: apt-cache policy openjdk-8-jdkĭo install the package: apt install openjdk-8-jdk etc/apt//91-debian-unstable.list deb unstable main So I use the same for unstables and add this file: In my case the output shows that server is used as system source. Just look to main sources list: cat /etc/apt/sources.list Now you're ready to add the unstable repository to the sources list.īefore I prefer to check what mirror was selected by me when system was installed. etc/apt//99defaultrelease APT::Default-Release "stable" If no (as by default) then set it as recommended in that answer by creating this file: So before adding unstable repository to the sources list make sure APT::Default-Release configuration option is set to "stable": grep -r Default-Release /etc/apt/ The negative output may imply that you prefer to use stable repositories and usually it isn't appropriate for you to update all other software from unstable repositories. If no then you need to add unstable repository to the sources list. Then check is this package can be installed with current configuration: apt-cache policy openjdk-8-jdk You can search the Debian packages site and find out the openjdk-8-jdk package for Debian 10 is only available from unstable (sid) repository currently.Īt first it is good to check and save current system-wide symbolic links for already installed Java SDK/JRE packages if any: ls -la /etc/alternatives | grep java > previous-java-alternatives.txt Note: You can use steps above to find an official Debian mirror with any other package you want to install Install openjdk 8 apt-get install openjdk-8-jdk Install software source manager apt-get updateĪpt-get install software-properties-commonĪdd mirror with openjdk-8-jdk apt-add-repository 'deb stretch/updates main' You should be able to use any of the listed mirrors by adding a line Now you can see mirrors list and instructions how to install the package via apt: Scroll to the Download openjdk-8-jdk section and choose your architecture.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |