# CircleCI build failure on OpenJDK image

**URL:** <https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104>\
**Category:** Build Environment\
**Created:** [October 29, 2018, 8:30pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104 "2018-10-29T20:30:42Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Svyatoslav](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Svyatoslav](https://discuss.circleci.com/u/Svyatoslav)\
**Post date:** [October 29, 2018, 8:30pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/1 "2018-10-29T20:30:42Z")

</div>

Hello everyone,

I have the following error when I run my CircleCI build.

```
   -------------------------------------------------------

```

## T E S T S

Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter  
Results :  
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0  
[INFO] ------------------------------------------------------------------------  
[INFO] BUILD FAILURE  
[INFO] ------------------------------------------------------------------------  
[INFO] Total time: 18.358 s  
[INFO] Finished at: 2018-10-29T19:06:42Z  
[INFO] ------------------------------------------------------------------------  
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test)  
on project ITEL: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test  
failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?  
[ERROR] Command was /bin/sh -c cd /home/circleci/project && /usr/lib/jvm/java-8-openjdkamd64/  
jre/bin/java -jar /home/circleci/project/target/surefire/surefirebooter5978716246735215649.jar  
/home/circleci/project/target/surefire/surefire950994743239780003tmp  
/home/circleci/project/target/surefire/surefire\_06908202691549979861tmp  
[ERROR] -\> [Help 1]  
[ERROR]  
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.  
[ERROR] Re-run Maven using the -X switch to enable full debug logging.  
[ERROR]  
[ERROR] For more information about the errors and possible solutions, please read the following articles:  
[ERROR] [Help 1] [http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException](http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException)  
Exited with code 1

Few days ago everything worked fine. Since then nothing in configuration was changed.  
When I run me tests locally the error doesn’t occur.

If more details are needed I will provide.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![um-zagaa](https://avatars.discourse-cdn.com/v4/letter/u/2acd7d/32.png) [@um-zagaa](https://discuss.circleci.com/u/um-zagaa)\
**Post date:** [October 30, 2018, 3:46am UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/2 "2018-10-30T03:46:44Z")

</div>

I got same ERROR since 2018/10/26 00:52:00 UTC.

pom setting is

> ```
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <configuration>
> <!-- CircleCI build workaround -->
> <argLine>${surefireArgLine} -Xms1024m -Xmx2048m</argLine>
> <reuseForks>true</reuseForks>
> </configuration>
> <version>2.20.1</version><!--$NO-MVN-MAN-VER$-->
> 
> ```

using

> Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T18:33:14Z)  
> Maven home: /opt/apache-maven  
> Java version: 1.8.0\_181, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre  
> Default locale: en, platform encoding: UTF-8  
> OS name: “linux”, version: “4.4.0-137-generic”, arch: “amd64”, family: “unix”

i think it may related OpenJDK updated version.  
But i have not got any clue.  
Does anyone resolved it?

---

<div class="post-metadata">

**Author:** ![um-zagaa](https://avatars.discourse-cdn.com/v4/letter/u/2acd7d/32.png) [@um-zagaa](https://discuss.circleci.com/u/um-zagaa)\
**Post date:** [October 30, 2018, 5:23am UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/3 "2018-10-30T05:23:20Z")

</div>

@Svyatoslav  
Below configuration worked for me.

**Reason :** Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter  
**Solution :** Set `useSystemClassLoader` to `false`

```
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <!-- CircleCI build workaround -->
                <argLine>${surefireArgLine} -Xms1024m -Xmx2048m</argLine>
                <reuseForks>true</reuseForks>
                <useSystemClassLoader>false</useSystemClassLoader>
            </configuration>
            <version>2.20.1</version><!--$NO-MVN-MAN-VER$-->
        </plugin>
```

---

<div class="post-metadata">

**Author:** ![Svyatoslav](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Svyatoslav](https://discuss.circleci.com/u/Svyatoslav)\
**Post date:** [October 30, 2018, 7:05am UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/4 "2018-10-30T07:05:22Z")

</div>

Thank you very much indeed for sharing that answer, it works. 👍😀

---

<div class="post-metadata">

**Author:** ![jerolba](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jerolba](https://discuss.circleci.com/u/jerolba)\
**Post date:** [October 30, 2018, 9:59am UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/5 "2018-10-30T09:59:30Z")

</div>

Same problem here.  
The solution works, but I want to know why this happens.  
What changed?

---

<div class="post-metadata">

**Author:** ![andskiba](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/andskiba/32/18658_2.png) [@andskiba](https://discuss.circleci.com/u/andskiba)\
**Post date:** [October 30, 2018, 12:48pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/6 "2018-10-30T12:48:23Z")

</div>

I also experienced this error. It would be really nice to know what the root cause of this is. Thanks for the solution though 🙂

---

<div class="post-metadata">

**Author:** ![rferreira](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rferreira/32/19581_2.png) [@rferreira](https://discuss.circleci.com/u/rferreira)\
**Post date:** [October 30, 2018, 1:20pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/7 "2018-10-30T13:20:18Z")

</div>

Yup same here, all builds all the sudden are broken, obviously CircleCI changed something but I’m not even sure what would cause this to, all-the-sudden, break - CirclCI folks, any ideas?

---

<div class="post-metadata">

**Author:** ![postalservice14](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/postalservice14/32/13268_2.png) [@postalservice14](https://discuss.circleci.com/u/postalservice14)\
**Post date:** [October 30, 2018, 2:29pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/8 "2018-10-30T14:29:07Z")

</div>

I believe what changed was the circleci docker images tagged as `circleci/openjdk:8-*` upgrade from Java 8u171 to 8u181.

I found this report that sheds a little light on it: [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925)

---

<div class="post-metadata">

**Author:** ![danhnguyensada](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/danhnguyensada/32/21405_2.png) [@danhnguyensada](https://discuss.circleci.com/u/danhnguyensada)\
**Post date:** [October 30, 2018, 6:04pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/9 "2018-10-30T18:04:56Z")

</div>

I rolled back to 8u171 and got my builds work again.  
`- image: circleci/openjdk:8u171-jdk`

---

<div class="post-metadata">

**Author:** ![rohara](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rohara/32/5744_2.png) [@rohara](https://discuss.circleci.com/u/rohara)\
**Post date:** [October 31, 2018, 1:56pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/10 "2018-10-31T13:56:11Z")

</div>

> [@postalservice14](#):
>
> from Java 8u171 to 8u181

That is incorrect. Java remained at 8u181.

The change is the build number from 1 to 2:

Old:

```auto
build 1.8.0_181-8u181-b13-1~deb9u1-b13

```

New:

```auto
build 1.8.0_181-8u181-b13-2~deb9u1-b13

```

---

<div class="post-metadata">

**Author:** ![sonoluminescence](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/sonoluminescence/32/19620_2.png) [@sonoluminescence](https://discuss.circleci.com/u/sonoluminescence)\
**Post date:** [November 1, 2018, 1:29am UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/11 "2018-11-01T01:29:32Z")

</div>

I’m also having the issue, which openjdk tag should I use? I’m not able to see the tag `8u171` in [https://hub.docker.com/r/circleci/openjdk/tags/](https://hub.docker.com/r/circleci/openjdk/tags/). Can I still use it? Thanks

---

<div class="post-metadata">

**Author:** ![eegiimgl](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/eegiimgl/32/19642_2.png) [@eegiimgl](https://discuss.circleci.com/u/eegiimgl)\
**Post date:** [November 2, 2018, 3:41pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/12 "2018-11-02T15:41:44Z")

</div>

Hey guys, I hit the same problem by using `circleci/openjdk:8-jdk` image to build in circleci. Which image for alternative for solving this?  
@um-zagaa Can you point me what this piece actually doing? `<useSystemClassLoader>false</useSystemClassLoader>`

---

<div class="post-metadata">

**Author:** ![um-zagaa](https://avatars.discourse-cdn.com/v4/letter/u/2acd7d/32.png) [@um-zagaa](https://discuss.circleci.com/u/um-zagaa)\
**Post date:** [November 5, 2018, 12:21am UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/13 "2018-11-05T00:21:16Z")

</div>

Hi @eegiimgl  
`userSystemClassLoader=true` is using manifest-only JAR, `userSystemClassLoader=false` is using basic plain old Java classpath.

read details from here [Class Loading](https://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html)

btw, I am mongolian too 😅

---

<div class="post-metadata">

**Author:** ![simple-elf](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@simple-elf](https://discuss.circleci.com/u/simple-elf)\
**Post date:** [November 5, 2018, 7:17am UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/14 "2018-11-05T07:17:05Z")

</div>

Thanks a lot!!! That saves my day!!!

---

<div class="post-metadata">

**Author:** ![eegiimgl](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/eegiimgl/32/19642_2.png) [@eegiimgl](https://discuss.circleci.com/u/eegiimgl)\
**Post date:** [November 5, 2018, 7:45pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/15 "2018-11-05T19:45:51Z")

</div>

Oh cool! Thanks!  
It helped to me. @um-zagaa Nice to meet you!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [November 15, 2018, 7:45pm UTC](https://discuss.circleci.com/t/circleci-build-failure-on-openjdk-image/26104/16 "2018-11-15T19:45:51Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
