Closed izhangzhihao closed 7 years ago
This looks like a bug. For some reason, we are removing the symlink, but not reloading jdk_switcher
. The function still thinks that the $JAVA_HOME
is the symlink that's removed, and the switch fails.
Could you try setting $JAVA_HOME
to /usr/lib/jvm/java-8-oracle
until we fix this?
I think this is the relevant commit: https://github.com/travis-ci/travis-build/commit/59a3db66d697ca44cb60154cc8ab9c1f83d648d6
I have similar issue, in my travis config I use php language and sudo trusty dist. but I install solr on top of it, and some time ago it started to erroring:
The currently defined JAVA_HOME (/usr/lib/jvm/java-8-oracle-amd64) refers to a location where Java could not be found. Aborting. Either fix the JAVA_HOME variable or remove it from the environment so that the system PATH will be searched.
I've tried to solved it as you recommended, defining JAVA_HOME directly, but it still keeps show me the message with old home path.
I have private repo, and payed travis plan, is it the right communication channel, or I should contact you in different channel ?
@maximgubar Sorry about the continued problem. Please email us at support@travis-ci.com.
@BanzaiMan thx! I try "export JAVA_HOME=/usr/lib/jvm/java-8-oracle" and it fixed!
I'm reopening this, since the bug still exists and it should be fixed.
Just started seeing the same issue this morning when trying to start elasticsearch
on trusty:
$ sudo service elasticsearch start
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME
FWIW, my .travis.yml
looks like this:
sudo: required
dist: trusty
language: node_js
node_js: '6'
cache:
directories:
- node_modules
services:
- mongodb
- elasticsearch
addons:
apt:
sources:
- elasticsearch-2.x
packages:
- elasticsearch
Since the promotion of the edge image to stable, see: https://docs.travis-ci.com/user/build-environment-updates/2016-12-01/
This issue can now happen for the default configuration.
sudo: required
dist: trusty
jdk:
- oraclejdk8
Known workarounds are:
group: deprecated
to the .travis.yml file to use the previous stable imagebefore_install:
- source /opt/jdk_switcher/jdk_switcher.sh
- jdk_switcher use oraclejdk8
Thank you, we'll post an update when it's resolved!
I have a runtime patch on the way via https://github.com/travis-ci/travis-build/pull/902
@MariadeAnton thanks for the workarounds. I tried setting JAVA_HOME
in before_install
. However, that's too late in the build cycle for me because elasticsearch
is installed and started via "APT Sources", which occurs prior to before_install
.
@meatballhat what's the timeframe for the patch? Will I need to set group: edge
, or will it be pushed directly to stable
?
@fyockm that patch will apply to all jobs, and should be live in under ~20m
@fyockm travis-ci/travis-build#902 is live now, btw :+1: Thanks for your patience! :heart:
@meatballhat I now see that source /opt/jdk_switcher/jdk_switcher.sh
is being run, but I'm still getting java is not present on your PATH.
. Is it now expected that I specify which JRE to use for xvfb?
@scasagrande-d2l the exact behavior depends on multiple variables. Do you have a job URL to which you can link?
@meatballhat I am also still getting the same error.
here's my job url: https://travis-ci.com/BessemerAlliance/voyant-models/jobs/58184176
@fyockm @scasagrande-d2l It looks like update-java-alternatives
is not successfully switching the system java. Still looking...
Any news @meatballhat ?
sorry all. so has all my computer issues been you guys? Just not sure if I blamed the wrong person or if it was her. If you have any idea what I'm talking about it would help (ha me asking for help) to know what has been happening. Or do I just sound crazy?
the workaround of putting "group: deprecated" in the .travis.yml has been working for me.
@scasagrande-d2l Sorry for delay. Spinning multiple plates. No update yet for group: stable
. Please use group: deprecated
to get un-blocked :+1: :heart:
I’ve worked around this by just calling java
with the full path:
/usr/lib/jvm/java-8-oracle/jre/bin/java
I’m sure that won’t work for all cases but it worked in mine at least.
@scasagrande-d2l you have to add
jdk:
- oraclejdk8
to tell the switcher to switch ;). this fixed it for me.
@mp-jgoetzinger Our problem is that we have several repos across multiple teams, so I'd rather not try to wrangle that mess.
This update included a fix that tested correctly during image mastering, yet I have confirmation that non-jvm language jobs do not have java
in $PATH
. I'm still working on a permanent fix. In the meantime, please continue to either stay on group: deprecated
or explicitly invoke jdk_switcher use default
(or whatever jdk you choose). Thanks for your patience and understanding, everyone :heart:
Latest cookbook changes look promising, fwiw.
I've hit a snag with one of the stacks that performs a deferred installation of lein
. Working on it...
There are some fresh Trusty stack images available that I'm very much hoping address the remaining issues. I'd appreciate input from anyone here who's able to run their jobs with:
group: edge
Can confirm that the edge
images fixes the problem, build with edge
: https://travis-ci.org/xhochy/arrow/jobs/180921629
(Failing build with stable
: https://travis-ci.org/xhochy/arrow/jobs/180629177 )
Can confirm getting solr to run on a language: php
job is broken as of last week.
Besides group: edge/deprecated
and script: jdk_switcher use oraclejdk8
workarounds, when is eta for fix in stable?
Can also confirm that group: edge
is working for me now :D
@andrerom I'm preparing a release for group: stable
right now, which will likely go out tomorrow morning US/Eastern 👍
I'll jump on the bandwagon - group: edge
fixes it for my use case as well. Thanks @meatballhat!
This is the group: stable
push that will include the fix currently available via group: edge
: https://docs.travis-ci.com/user/build-environment-updates/2016-12-06/
Please note that we currently do not have support for multiple group assignment, which means that once the above update goes live, anyone using group: edge
will likely experience a regression, as the image most recently tagged group: edge
will be from The Past ⌛️
This build env update is complete https://docs.travis-ci.com/user/build-environment-updates/2016-12-06/. Please holler if you are still experiencing issues on sudo-enabled Trusty that you believe are related to this issue 💖 .
Everything is back to normal for us now :) many thanks @meatballhat, I owe you one :D
what's wrong with my config?