Using JDK 10 in snap

I’m trying to use JDK10 in a snap by specifying:

stage-packages: [openjdk-10-jdk, vlc]

…however, it complains that the package openjdk-10-jdk isn’t found. Is it possible to build with Java 10 on snapcraft yet?

Do you really need openJDK 10? Will 8 or 9 be sufficient? Snaps are (recommended) built on Ubuntu Xenial (16.04) which doesn’t have openjdk 10 in the repo, but has 8 and 9.

An alternative method I have used is to dump the Oracle JDK directly into a snap (for the Minecraft snap) but switched to using OpenJDK because that worked just fine too.

Thanks for the reply - 8 is a no go for us unfortunately - that’s what we were using, but we’ve since had the need to use various APIs that are only in 9+ (such as the upgraded Desktop class.) 10 also has some scaling related bugfixes, so dropping down to 9 would really be a last resort.

I’m assuming there’s no plans you’re aware of to update to 18.04 in the near future, or a snap option to switch to that release? If not I may take your approach of directly grabbing the JDK from within the snap - I’d just like to avoid that if possible!

I also need JDK 10 for my Snap. The project specifically requires JDK 10. Are there any tips or examples on getting JDK 10 when using core18?

Never mind, I realized that JDK 10 is in core18 base as the package openjdk-11-jdk.

1 Like