Upgrade to JDK12?

JDK 11.0.2 has a bug which is solved in JDK 12 (and backported to 11.0.4).

`compiler message file broken: key=compiler.misc.msg.bug arguments=11.0.2, {1}, {2}, {3}, {4}, {5}, {6}, {7}`

This seems to be related to:


https://bugs.openjdk.java.net/browse/JDK-8212586
http://hg.openjdk.java.net/jdk/jdk/rev/bbbc110cdffe

My pipeline fails, because circle ci is still on an old JDK (11.0.2), and althought the circle ci docker files for JDK12 are ready, they are not on a docker registry.
I know I can make my own Dockerfile, but it would make more sense to let circle ci do it, since they already have the file. Are there any plans to add JDK12 circle ci docker containers to a docker registry?

Thx, Kurt

1 Like

Hey @kurtsys,

Thank you for joining us on Discuss. The fact that there are Dockerfiles for this image but it’s not available means that there’s an issue somewhere. Let us look into it and we’ll get back to you.

Would love to have this jdk12 as well, we need it to be able to build our elasticsearch plugin. Anything I can do to help? Not that experienced with Docker and Circleci yet, but always happy to help if i can.

Any update on this? I was planning on using CircleCI, but don’t see how to use it for my JDK12-based project.

Assuming you are using the Docker executor, just pull whatever image you need from Docker Hub. Or, if you want more control, roll your own and have a pipeline for that too.

Well I’m new to CircleCI, so pointers to newbie-level instructions would be helpful, e.g., an example of a configuration that uses a JDK Docker image to do this.

Heh, righto. Are you familiar with Docker? Docker Hub is probably the best place to start. Assuming OpenJDK is OK for you, peruse the tags in the list - there are plenty of them depending on what you want/need - and swap them for the circleci/* image you are currently using.

For example, let’s say you want JDK 12 on Linux. I would guess 12-jdk is a good place to start, so you would use openjdk:12-jdk as your image name. So, using the Docker executor, your config would look a bit like this:

jobs:
  build:
    docker:
      - image: openjdk:12-jdk

There may be some installed software that one would normally get in circleci/* images, in which case you would need to install that. I wonder, from that tag list, whether this image is based on Oracle Linux. That appears to use Yum as its package manager, which will let you install other things as required.

I have built a custom image (image: codeaches/openjdk:12-jdk) on Docker Hub which has JDK 12, maven, ant, gradle on Alpine. If you are using the Docker to build your code, you can use this one I guess…

Your CircleCI yml file will be something like this…

jobs:
  build:
    docker:
      - image: codeaches/openjdk:12-jdk

I have used this setup in one of my Maven Java project to build my code using Maven (and Java 12). You can take a look at it here https://github.com/codeaches/spring-boot-kafka-examples

You can check out the image: codeaches/openjdk:12-jdk Image details here: https://hub.docker.com/r/codeaches/openjdk

Hope it helps…

3 Likes

For our Elasticsearch plugin, I ended up just making a simple image with the right jdk versions we need. As ES tends to upgrade Java agressively, I suspect we’ll stick to our own dockerfile:

@softwaredoug - regarding your note on that GitHub issue, you can switch either to a (paid) Docker memory upgrade, or install Docker in a Machine executor, and get an 8G VM for free (it has been noted the price could change in a future review, but it’s been free for 18+ months already).