# \_JAVA\_OPTIONS environment variable on xenial

**URL:** <https://travis-ci.community/t/java-options-environment-variable-on-xenial/799>\
**Category:** Xenial\
**Created:** [November 9, 2018, 7:54am UTC](https://travis-ci.community/t/java-options-environment-variable-on-xenial/799 "2018-11-09T07:54:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sormuras](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sormuras/32/2770_2.png) [@sormuras](https://travis-ci.community/u/sormuras)\
**Post date:** [November 9, 2018, 7:54am UTC](https://travis-ci.community/t/java-options-environment-variable-on-xenial/799/1 "2018-11-09T07:54:15Z")

</div>

The xenial image sets the \_JAVA\_OPTIONS environment variable. Isn’t this a relic from the container-based (`sudo: false`) image?

Can this environment variable be removed from xenial? Otherwise each Java-based command emits something like \_"Picked up _JAVA\_OPTIONS: -Xmx2048m -Xms512m"_ as the first line on the console.

---

<div class="post-metadata">

**Author:** ![joepvd](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/joepvd/32/98_2.png) [@joepvd](https://travis-ci.community/u/joepvd)\
**Post date:** [November 29, 2018, 10:35am UTC](https://travis-ci.community/t/java-options-environment-variable-on-xenial/799/2 "2018-11-29T10:35:18Z")

</div>

Thanks! This will be resolved with the next image bump:

> <https://github.com/travis-ci/travis-cookbooks/pull/1008/commits/7ef97227a10b80bcf7cb9f9fcb146efdeb7cc6b9>

---

<div class="post-metadata">

**Author:** ![codylerum](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/codylerum/32/433_2.png) [@codylerum](https://travis-ci.community/u/codylerum)\
**Post date:** [December 13, 2018, 10:13pm UTC](https://travis-ci.community/t/java-options-environment-variable-on-xenial/799/3 "2018-12-13T22:13:40Z")

</div>

Thanks! I just tried another build and it did properly pick up Java8

However I’m now getting this error for each of my tests

```
`Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter`

```

Is M2\_Home set as an enviromental variable? Appears that could be an issue if so.

> <https://stackoverflow.com/questions/33133809/maven-error-could-not-find-or-load-main-class-org-codehaus-plexus-classworlds/33190546#33190546>

---

<div class="post-metadata">

**Author:** ![codylerum](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/codylerum/32/433_2.png) [@codylerum](https://travis-ci.community/u/codylerum)\
**Post date:** [January 18, 2019, 2:12am UTC](https://travis-ci.community/t/java-options-environment-variable-on-xenial/799/4 "2019-01-18T02:12:29Z")

</div>

This seems to be working ok now in the current Xenial builds.
