Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package OpenJDK for Debian #25

Closed
jabrena opened this issue Aug 22, 2018 · 28 comments
Closed

Package OpenJDK for Debian #25

jabrena opened this issue Aug 22, 2018 · 28 comments
Projects
Milestone

Comments

@jabrena
Copy link

jabrena commented Aug 22, 2018

Currently, the project provides a stable build for OpenJDK 11 for ARM32 (Raspberry Pi) with the following Jenkins Job:
https://ci.adoptopenjdk.net/view/arm/job/openjdk11_build_arm32_linux/

We should consider to design a solution to package and publish on Debian:
https://wiki.debian.org/Java

Once the build, passes the different Test suites from:
https://github.com/AdoptOpenJDK/openjdk-tests/

Juan Antonio

@nohn
Copy link

nohn commented Sep 18, 2018

I'd suggest to change this to be more generic: "Package OpenJDK for Debian"

@jabrena
Copy link
Author

jabrena commented Sep 18, 2018

Fixed

@jabrena jabrena changed the title Package OpenJDK 11 for Debian Package OpenJDK for Debian Sep 18, 2018
@karianna karianna transferred this issue from adoptium/temurin-build Nov 19, 2018
@karianna karianna added this to To do in installer via automation Nov 19, 2018
@rpardini
Copy link

Hi, check out https://github.com/rpardini/adoptopenjdk-deb-installer
It's an effort to build Debian/Ubuntu installer packages via a generator that consumes the AdoptOpenJDK API. Ubuntu packages for testing are available at a Launchpad PPA already.
I would love to contribute this to AdoptOpenJDK if you're interested. Let me know...

@jabrena
Copy link
Author

jabrena commented Nov 25, 2018

I will test it

@gdams
Copy link
Member

gdams commented Nov 25, 2018

hey @rpardini, thanks for the link! could you join our slack channel at https://adoptopenjdk.net/slack and we could perhaps setup a call to discuss what you've been able to do so far!

@flybd5
Copy link

flybd5 commented Dec 6, 2018

We could use one for Java 8 as well...

@basil
Copy link

basil commented Dec 7, 2018

I needed a .deb package of AdoptOpenJDK recently. I cobbled together this temporary solution using make-jpkg(1). It's based on this upstream merge request. I am sharing this in case others find it useful. Perhaps it might help some people in the short term until official .deb packages are provided.

@flybd5
Copy link

flybd5 commented Dec 7, 2018

Your solution works great, @basil, thank you! :) For those of you interested in trying it, I reduced it to this:

git clone https://salsa.debian.org/java-team/java-package.git
cd java-package/
git fetch https://salsa.debian.org/JanMa-guest/java-package.git feature/add-support-for-adopt-openjdk
git checkout -b JanMa-guest/java-package-feature/add-support-for-adopt-openjdk FETCH_HEAD
git rebase origin/master

Stop here and fix the typo in java-package/lib/adopt-open-jdk.sh on line 162. On the line that begins with "Provides: " remove LF at the end and make one line with the next.

dpkg-buildpackage -b -us -uc
cd ..
sudo apt install libgl1-mesa-glx
sudo dpkg -i java-package_0.63_all.deb
wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u192-b12/OpenJDK8U-jdk_x64_linux_hotspot_8u192b12.tar.gz
sha256sum OpenJDK8U-jdk_x64_linux_hotspot_8u192b12.tar.gz
env DEB_BUILD_OPTIONS=nostrip fakeroot make-jpkg OpenJDK8U-jdk_x64_linux_hotspot_8u192b12.tar.gz <<<y

The result is:

The Debian package has been created in the current directory.
You can install the package as root with:

    dpkg -i adoptopenjdk-java8-jdk_8u192b12_amd64.deb

It works fine for Java 11 as well. I have already submitted a merge request to fix that typo referenced above. Once that is merged no fix needs to be applied.

@dennisl
Copy link

dennisl commented Mar 13, 2019

What is the long term plan for this? We are looking at switching Java 8 from Oracle to AdoptOpenJDK on our Ubuntu servers. Our server maintainers wants OS native packages, since that makes their job so much easier.

@aahlenst
Copy link
Contributor

Work in progress, see #61.

@gdams
Copy link
Member

gdams commented Mar 25, 2019

For anyone wanting to test a deb file we've generated a sample jdk11 one here: https://ci.adoptopenjdk.net/view/work%20in%20progress/job/andreas-deb-job/10/artifact/linux/deb/build/adoptopenjdk-11-hotspot_11.0.2+9-1_amd64.deb Please let me know if there are any issues/bugs.

@karianna karianna added this to the March 2019 milestone Mar 25, 2019
@karianna karianna modified the milestones: March 2019, April 2019 Apr 4, 2019
@nudgegoonies
Copy link
Contributor

We build the debian and rpm packages this way now and are testing them. One feature wish. Please provide seperate jdk / jre packages. The jdk package is too big for docker-images that need only the jre.

@aahlenst
Copy link
Contributor

@nudgegoonies I'm working on it, but still trying to figure out what the best strategy is to provide the JREs because JDKs and JREs overlap.

@aahlenst
Copy link
Contributor

There are going to be completely separate packages (no dependencies on each other):

$ apt search adoptopenjdk
Sorting... Done
Full Text Search... Done
adoptopenjdk-12-hotspot/now 12.0.1+12-1 amd64 [installed,local]
  OpenJDK Development Kit 12 (JDK) by AdoptOpenJDK

adoptopenjdk-12-hotspot-jre/now 12.0.1+12-1 amd64 [installed,local]
  OpenJDK Runtime Environment 12 (JRE) by AdoptOpenJDK

$ update-java-alternatives -l
adoptopenjdk-12-hotspot-amd64     1121       /usr/lib/jvm/adoptopenjdk-12-hotspot-amd64
adoptopenjdk-12-hotspot-jre-amd64 1121       /usr/lib/jvm/adoptopenjdk-12-hotspot-jre-amd64

If the full JDK is installed, there's no need to install the JRE.

@karianna karianna moved this from To do to In progress in installer Apr 29, 2019
@nudgegoonies
Copy link
Contributor

@aahlenst Great! Thank you very much. I look forward to try it out. Do you already have a branch?

The overlap is problematic, yes. The openjdk package within debian are very splitted. But i would suggest to use a jdk+jre and a jre package that "conflict" each other in the debian "control" file to make things not too complicated.

Have you thought about a solution for the ca-certificates? We have an internal script that does this but it better would be updating debian directly here to add the paths:
https://salsa.debian.org/java-team/ca-certificates-java/blob/master/debian/jks-keystore.hook.in

@nudgegoonies
Copy link
Contributor

Regarding dependencies we found this would be usefull to reduce size:
#96

@aahlenst
Copy link
Contributor

@nudgegoonies What do you have in mind regarding ca-certificates? I currently cheat by depending on ca-certificates-java, therefore /etc/ssl/certs/java/cacerts should be there and it is generated from /etc/ssl/certs.

@nudgegoonies
Copy link
Contributor

@aahlenst Please excuse me. I try to describe in more details.

/etc/ssl/certs/java/cacerts is there and is generated from all certificates in /usr/share/ca-certificates by ca-certificates-java. But adoptopenjdk does not pick it up. I verified this with sslpoke. In the debian openjdk package its cacerts file is just a symlink to /etc/ssl/certs/java/cacerts. In the adoptopenjdk debian package it is still the cacert file from the official adoptopenjdk tar.gz and thus does not contain certificates from debian or locally installed certificates:
/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/jre/lib/security/cacerts

Our internal script is a workaround hookup script in /etc/ca-certificates/update.d that finds all JVMs beneath /usr/lib/jvm and imports all certificates there too. And i had to adjust this to support the adoptopenjdk packages. But i find the symlink approach of the debian openjdk package better. Especially when you depend on ca-certificates-java.

Please forget what i have written about the official script.

@aahlenst
Copy link
Contributor

@nudgegoonies Thanks for the explanation. Will fix by linking to /etc/ssl/certs/java/cacerts.

@dennisl
Copy link

dennisl commented Apr 30, 2019

May I suggest to create a separate issue for the JRE package. This issue is long enough as it is 😃

@karianna karianna removed this from the April 2019 milestone May 1, 2019
@karianna karianna added this to the May 2019 milestone May 1, 2019
@nudgegoonies
Copy link
Contributor

@aahlenst I tried your JRE branch to build the packages here. Works fine for us,

By the way, all bintray options have to be set when using build targets. Is this intended?

@aahlenst
Copy link
Contributor

aahlenst commented May 3, 2019

Having to define all Bintray variables even if you don't use the upload tasks is not intended, but my Gradle skills haven't yet found a way around it without having to forgo Gradle's input validation.

@nudgegoonies
Copy link
Contributor

@aahlenst Thank you for the answer. I am used to maven and this is the first gradle project i see so i have no skills yet too. It works with giving all parameters with dummy values.

@stellirin
Copy link

I tested the RPM found at https://dl.bintray.com/adoptopenjdk/rpm-nightly/centos/7/x86_64/Packages/ and it works, but it pulls in some i686 dependencies, which is unexpected. As a test I replaced installing the OS provided JDK in a Dockerfile, which results in a final image of 180MB larger than installing the OS provided JDK.

AdoptOpenJDK

Installing:
 adoptopenjdk-11-hotspot    x86_64 11.0.2+9-1       /adoptopenjdk-11-hotspot-11.0.2+9-1.x86_64
                                                                          310 M
 dejavu-lgc-sans-fonts         noarch    2.33-6.el7            base       1.0 M
 dejavu-lgc-sans-mono-fonts    noarch    2.33-6.el7            base       359 k
 dejavu-lgc-serif-fonts        noarch    2.33-6.el7            base       639 k
 dejavu-sans-fonts             noarch    2.33-6.el7            base       1.4 M
 dejavu-sans-mono-fonts        noarch    2.33-6.el7            base       433 k
 dejavu-serif-fonts            noarch    2.33-6.el7            base       776 k
 fontconfig                    x86_64    2.13.0-4.3.el7        base       254 k
 nmap-ncat                     x86_64    2:6.40-16.el7         base       206 k
 which                         x86_64    2.20-7.el7            base        41 k
Installing for dependencies:
 alsa-lib                      i686      1.1.6-2.el7           base       424 k
 dejavu-fonts-common           noarch    2.33-6.el7            base        64 k
 fontpackages-filesystem       noarch    1.44-8.el7            base       9.9 k
 freetype                      x86_64    2.8-12.el7_6.1        updates    380 k
 glibc                         i686      2.17-260.el7_6.4      updates    4.3 M
 libX11                        i686      1.6.5-2.el7           base       610 k
 libX11-common                 noarch    1.6.5-2.el7           base       164 k
 libXau                        i686      1.0.8-2.1.el7         base        29 k
 libXext                       i686      1.3.3-3.el7           base        39 k
 libXi                         i686      1.7.9-1.el7           base        40 k
 libXrender                    i686      0.9.10-1.el7          base        25 k
 libXtst                       i686      1.2.3-1.el7           base        20 k
 libpcap                       x86_64    14:1.5.3-11.el7       base       138 k
 libpng                        x86_64    2:1.5.13-7.el7_2      base       213 k
 libxcb                        i686      1.13-1.el7            base       230 k
 nss-softokn-freebl            i686      3.36.0-5.el7_5        base       211 k
 zlib                          i686      1.2.7-18.el7          base        91 k
Updating for dependencies:
 glibc                         x86_64    2.17-260.el7_6.4      updates    3.7 M
 glibc-common                  x86_64    2.17-260.el7_6.4      updates     12 M

CentOS Provided

Installing:
 dejavu-lgc-sans-fonts         noarch    2.33-6.el7            base       1.0 M
 dejavu-lgc-sans-mono-fonts    noarch    2.33-6.el7            base       359 k
 dejavu-lgc-serif-fonts        noarch    2.33-6.el7            base       639 k
 dejavu-sans-fonts             noarch    2.33-6.el7            base       1.4 M
 dejavu-sans-mono-fonts        noarch    2.33-6.el7            base       433 k
 dejavu-serif-fonts            noarch    2.33-6.el7            base       776 k
 fontconfig                    x86_64    2.13.0-4.3.el7        base       254 k
 java-11-openjdk-headless      x86_64    1:11.0.3.7-0.el7_6    updates     38 M
 nmap-ncat                     x86_64    2:6.40-16.el7         base       206 k
 which                         x86_64    2.20-7.el7            base        41 k
Installing for dependencies:
 alsa-lib                      x86_64    1.1.6-2.el7           base       424 k
 copy-jdk-configs              noarch    3.3-10.el7_5          base        21 k
 dejavu-fonts-common           noarch    2.33-6.el7            base        64 k
 fontpackages-filesystem       noarch    1.44-8.el7            base       9.9 k
 freetype                      x86_64    2.8-12.el7_6.1        updates    380 k
 javapackages-tools            noarch    3.4.1-11.el7          base        73 k
 libjpeg-turbo                 x86_64    1.2.90-6.el7          base       134 k
 libpcap                       x86_64    14:1.5.3-11.el7       base       138 k
 libpng                        x86_64    2:1.5.13-7.el7_2      base       213 k
 libxslt                       x86_64    1.1.28-5.el7          base       242 k
 lksctp-tools                  x86_64    1.0.17-2.el7          base        88 k
 python-javapackages           noarch    3.4.1-11.el7          base        31 k
 python-lxml                   x86_64    3.2.1-4.el7           base       758 k
 tzdata-java                   noarch    2019a-1.el7           updates    187 k

@aahlenst
Copy link
Contributor

aahlenst commented May 6, 2019

@stellirin Would you mind opening a separate issue? Makes it easier to keep track of it and to limit the scope of the discussion.

@Pr0methean
Copy link

Pr0methean commented May 10, 2019

Putting it in the repo would be the easiest way yet to avoid both stale versions and "mystery meat" OpenJDK builds on Ubuntu! Also a fantastic way to drop in OpenJ9 as a replacement, especially in the bare-metal world.

@rpardini
Copy link

A PPA would be the easiest way yet to avoid both stale versions and "mystery meat" OpenJDK builds on Ubuntu! Also a fantastic way to drop in OpenJ9 as a replacement, especially in the bare-metal world.

Hijacking this, again, sorry.
This repo is about the binaries-containing (multiple megabyte), official, AOJ packages, that will be published on a Debian/Ubuntu repo.
I've made non-official installer packages at https://github.com/rpardini/adoptopenjdk-deb-installer (with PPA, OpenJ9, etc; the packages are minimal (kilobytes) and download the JDK/JRE from the official sources on your own machine).

@gdams
Copy link
Member

gdams commented May 20, 2019

Closing as this is now complete! check out https://medium.com/adoptopenjdk/adoptopenjdk-rpm-and-deb-files-7003ba38144e for more info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
installer
  
Done
Development

No branches or pull requests