# JAVA\_HOME incorrect in debug mode

**URL:** <https://travis-ci.community/t/java-home-incorrect-in-debug-mode/4996>\
**Category:** Java\
**Tags:** bug, debug-mode\
**Created:** [September 4, 2019, 8:11pm UTC](https://travis-ci.community/t/java-home-incorrect-in-debug-mode/4996 "2019-09-04T20:11:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eranavidor](https://avatars.discourse-cdn.com/v4/letter/e/71c47a/32.png) [@eranavidor](https://travis-ci.community/u/eranavidor)\
**Post date:** [September 4, 2019, 8:11pm UTC](https://travis-ci.community/t/java-home-incorrect-in-debug-mode/4996/1 "2019-09-04T20:11:56Z")

</div>

I have a travis build using

```
language: java
jdk: openjdk12

```

Everything is working fine during normal builds, but when I debug the build, the `JAVA_HOME` environment variable is set to an older JDK version.

Normal build:  
echo $JAVA\_HOME  
/home/[secure]/openjdk12

Debug build:  
echo $JAVA\_HOME  
/usr/lib/jvm/java-8-oracle

I could find this related [issue](https://github.com/travis-ci/travis-ci/issues/8006) (already closed)

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [September 5, 2019, 3:59am UTC](https://travis-ci.community/t/java-home-incorrect-in-debug-mode/4996/2 "2019-09-05T03:59:26Z")

</div>

Could you copy/paste a link to your latest build where this is working in normal/non-debug mode?
