# Error during building openmrs core (Corrupted STDOUT by directly writing to native stream)

**URL:** <https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353>\
**Category:** Uncategorized\
**Created:** [May 5, 2021, 7:25am UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353 "2021-05-05T07:25:49Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 5, 2021, 7:25am UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/1 "2021-05-05T07:25:49Z")

</div>

On a fresh clone of openmrs-core,i pull the latest changes from upstream,and try building using maven clean install ,i then run into Corrupted STDOUT by directly writing to native stream error as seen here in the full logs [G:\openmrs\openmrs-core\>mvn clean install[INFO] Scanning for projects...[INF - Pastebin.com](https://pastebin.com/1cscTdtu) .Will be grate full for any work around to get this fixed!! cc @dkayiwa@ibacher

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [May 5, 2021, 3:05pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/2 "2021-05-05T15:05:56Z")

</div>

What’s the output of `mvn -v`?

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 5, 2021, 3:07pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/3 "2021-05-05T15:07:30Z")

</div>

thanks @ibacher its

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: C:\Program Files\apache-maven-3.6.3\bin… Java version: 1.8.0-262, vendor: OpenLogic-OpenJDK, runtime: C:\Program Files\java\jre Default locale: en\_US, platform encoding: Cp1252 OS name: “windows 10”, version: “10.0”, arch: “x86”, family: “windows”

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [May 5, 2021, 3:11pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/4 "2021-05-05T15:11:47Z")

</div>

Can you try running it again with the `-X` parameter, e.g. `mvn -X clean install`.

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 5, 2021, 3:21pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/5 "2021-05-05T15:21:22Z")

</div>

logs are kinder big,i had to use note pad.On running `mvn -X clean install` i get [logs.txt](https://talk.openmrs.org/uploads/short-url/3PO7oKKdpk16sCy0kCNRZfiHSYQ.txt) (760.6 KB)

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [May 5, 2021, 3:52pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/6 "2021-05-05T15:52:00Z")

</div>

In [theory](https://maven.apache.org/surefire/maven-failsafe-plugin/faq.html#corruptedstream) that should’ve given us some more information, but I’m none the wiser for having looked at that.

Do things work if you run `mvn clean install -Dfork=false`?

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 5, 2021, 6:27pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/7 "2021-05-05T18:27:57Z")

</div>

> [@ibacher](#):
>
> mvn clean install -Dfork=false

hi @ibacher,on running the above i get [Microsoft Windows [Version 10.0.19041.928](c) Microsoft Corporation. All right - Pastebin.com](https://pastebin.com/3x6nixNS)

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [May 5, 2021, 6:46pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/8 "2021-05-05T18:46:04Z")

</div>

Ok… two suggestions:

1. Can you pull the latest changes to Core? @dkayiwa just updated the Jacoco version in core and I suspect that’s the part that’s causing the issue.

If that doesn’t work try:

1. Comment out [this plugin](https://github.com/openmrs/openmrs-core/blob/95b784175f73ad767242ff9d1ec83ad1be99e6c2/pom.xml#L789) in your local copy of the POM, but please don’t commit that.

PS I’m sorry I don’t have an easy solution for you.

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 5, 2021, 6:51pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/9 "2021-05-05T18:51:33Z")

</div>

thats ok @ibacher ,on my search too around gooogle i see the error has some relation with Jacoco version ,let me try out the suggestions and see how things go,will let you know,thanks

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 5, 2021, 9:43pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/10 "2021-05-05T21:43:55Z")

</div>

> [@ibacher](#):
>
> 1. Can you pull the latest changes to Core? @dkayiwa just updated the Jacoco version in core and I suspect that’s the part that’s causing the issue.
> 
> If that doesn’t work try:
> 
> 1. Comment out [this plugin](https://github.com/openmrs/openmrs-core/blob/95b784175f73ad767242ff9d1ec83ad1be99e6c2/pom.xml#L789) in your local copy of the POM, but please don’t commit that.

still breaks with the above, let me continue trying out a couple of suggested solutions online

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 5, 2021, 10:33pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/11 "2021-05-05T22:33:52Z")

</div>

@ibacher to solve this i have specified the maximum allowed JVM heap size ie added this to the environment variables in windows,Variable name: \_JAVA\_OPTIONS  
and Variable value: -Xmx512M.I can now run mvn clean install successfully thanks much

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [May 6, 2021, 8:23am UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/12 "2021-05-06T08:23:15Z")

</div>

@herbert24 can you confirm that we you change that to a lower value, you get exactly the same error as before?

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 7, 2021, 10:25am UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/13 "2021-05-07T10:25:28Z")

</div>

> [@dkayiwa](#):
>
> can you confirm that we you change that to a lower value, you get exactly the same error as before?

@dkayiwa building this with Xmx100M breaks with out of memory, am trying another value

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [May 7, 2021, 11:37am UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/14 "2021-05-07T11:37:53Z")

</div>

Xmx200M breaks things while Xmx300M builds successfully

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [May 7, 2021, 12:58pm UTC](https://talk.openmrs.org/t/error-during-building-openmrs-core-corrupted-stdout-by-directly-writing-to-native-stream/33353/15 "2021-05-07T12:58:52Z")

</div>

@herbert24 breaks with what error message?
