Openjdk-11-jre-headless

Hello,

I currently build a package with openjdk-8 and it works.
build-packages’: openjdk-8-jre-headless

I am trying to build the package with the new openjdk-11 but it fails
Could not find a required package in ‘build-packages’: openjdk-11-jre-headless
Error: not found

Can one advise how I can include a later version of openjdk than 8.

Many Thanks

Can you show the snapcraft.yaml file? Note that package openjdk-11-jre-headless is available with Ubuntu 18.04 but not Ubuntu 16.04:

Therefore you should be using core18.

Hello,

I know I have it installed:

$ dpkg --list | grep openjdk ii openjdk-11-jre-headless:amd64 11.0.7+10-3ubuntu1 amd64 OpenJDK Java runtime, using Hotspot JIT (headless)

The issue is when I try to add that to my snapcraft.yaml and run snapcraft cleanbuild it fails.

parts: smalltextpad: source: source plugin: dump organize: run_smalltextpad.sh: bin/run_smalltextpad.sh SmallTextPad_1.4.0.jar: bin/SmallTextPad_1.4.0.jar default.jar: bin/default.jar build-packages: - ca-certificates - ca-certificates-java - openjdk-11-jre-headless - libfreetype6 - fonts-freefont-ttf stage-packages: - openjdk-11-jre-headless

Here is the error:

Sorry, an error occurred in Snapcraft: Could not find a required package in ‘build-packages’: openjdk-11-jre-headless Error: not found Stopping local:snapcraft-muskily-tetrandrous-shera Sorry, an error occurred in Snapcraft:

Any assistance would be awesome ,

Thank you

So looks like if I run $ snapcraft cleanbuild it has a problem with openjdk-11, but then I run $ snapcraft clean and $ snapcraft

$ snapcraft builds the package and downloads the openjdk-11 without any issues until the end where I now get a different error:

Pulling smalltextpad Building smalltextpad Staging smalltextpad Priming smalltextpad Sorry, an error occurred in Snapcraft: The linker version ‘2.23’ used by the base ‘core’ is incompatible with files in this snap: /home/ricardo/packages/snap/smalltextpad/prime/lib/x86_64-linux-gnu/libexpat.so.1.6.11 (2.25) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/jvm/java-11-openjdk-amd64/lib/libawt.so (2.29) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so (2.29) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/jvm/java-11-openjdk-amd64/lib/libfontmanager.so (2.29) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so (2.29) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 (2.26) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libasound.so.2.0.0 (2.29) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libbsd.so.0.10.0 (2.25) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (2.25) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libexpatw.so.1.6.11 (2.25) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libgnutls.so.30.27.0 (2.25) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 (2.27) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8 (2.29) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libnspr4.so (2.30) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libp11-kit.so.0.3.0 (2.26) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libpng16.so.16.37.0 (2.29) /home/ricardo/packages/snap/smalltextpad/prime/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6 (2.29)

Is the above the complete snapcraft.yaml file? Have you tried core18 as suggested?

base: core18

I guess you’re still using core instead of core18:

Package openjdk-11-jre-headless is available with Ubuntu 18.04 (core18) but not Ubuntu 16.04 (core): https://packages.ubuntu.com/search?keywords=openjdk-11-jre-headless

Problem solved, I missed exporting lxd as this is a new installation of Ubuntu.

$ export SNAPCRAFT_BUILD_ENVIRONMENT=lxd

All goo, new openjdk and package built :slight_smile: