Hi,
I am trying to use the following script in travis.yml file, but travis still take jdk1.8
Blockquote
language: java
sudo: false
dist: xenial
jdk: zulu11.31.11-ca-fx-jdk11.0.3-linux_x64
before_script:
after_script:
- echo JAVA_HOME = ${JAVA_HOME}
- echo PATH = ${PATH}
- ls ${JAVA_HOME}
- java -version
Blockquote
please suggest me how to use it in Travis.
Thanks you in advance.
-Ab
Using https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz
works like a charm:
Ignore the Java version printed out before you tell install-jdk.sh
to install Zulu 11. That’s the defaut Java version provided by Travis CI’s image.
$ java -Xmx32m -version
java version “1.8.0_151”
Java™ SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot™ 64-Bit Server VM (build 25.151-b12, mixed mode)
Look at the tail of the log, and expand the folded java -version
entries.
1 Like
jayvdb
July 9, 2019, 12:15pm
3
1 Like
rsabhi
July 9, 2019, 12:16pm
4
Thank you very much for the reply. Even after downloading zulujdk11, travis still referring to jdk8
====== travis build result ===
build-init:
[mkdir] Created dir: /workdir/build/public-package-jars
Scanning for modules in /usr/local/netbeans-8.2/harness
Scanning for modules in /usr/local/netbeans-8.2/platform
Scanning for modules in suite /workdir
BUILD FAILED
/usr/local/netbeans-8.2/harness/suite.xml:187: The following error occurred while executing this line:
/usr/local/netbeans-8.2/harness/common.xml:225: Compile failed; see the compiler error output for details.
Your snippets shows “netbeans-8.2”… this has nothing to do with the underlying JDK version.
Can you please share a link to your repository and/or build log?
rsabhi
July 10, 2019, 2:39am
6
Hi sormuras,
Thank you for the reply. Please find the sample of yml file I use. Kindly suggest.
Blockquotejobs:
include:
stage: Run Tests
language: java
before_script:
stage: Build zip
language: java
before_script:
unset -v _JAVA_OPTIONS
wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
env: JDK=zulu11.31.11-ca-fx-jdk11.0.3-linux_x64
script: source install-jdk.sh --url https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-fx-jdk11.0.3-linux_x64.tar.gz
sudo: false
dist: trusty
script:
docker pull “$IMAGE_NAME” || true
docker run -v $(pwd):/workdir/ --workdir /workdir/ abc/netbeans-builder .travis/build-zip.sh
dist: trusty
sudo: required
services:
docker
env: IMAGE_NAME=abc/netbeans-builder
language: generic
after_script:
echo JAVA_HOME = ${JAVA_HOME}
echo PATH = ${PATH}
ls ${JAVA_HOME}
java -version
deploy:
provider: releases
api_key:
secure: jdjdjjdjdjdjdjdjjjdjdj
file: ‘dist/abc.zip’
on:
repo: abc/def
branch: master
tags: true
Looks like there’s an issue with how you setup your staged Travis CI script. Try to make it work without stages first.
DanySK
July 10, 2019, 9:11am
8
@rsabhi if the zulu JVM you need is available on Jabba you may consider using Gravis-CI
rsabhi
July 10, 2019, 3:10pm
9
Thanks
language: java
sudo: false
dist: trusty
before_script:
jobs:
include:
=====
I am getting error
Installing zulu8.38.0.13-ca-fx-jdk8.0.212
$ export JAVA_HOME=~/zulu8.38.0.13-ca-fx-jdk8.0.212
$ export PATH="$JAVA_HOME/bin:$PATH"
$ ~/bin/install-jdk.sh --target “/home/travis/zulu8.38.0.13-ca-fx-jdk8.0.212” --workspace “/home/travis/.cache/install-jdk” --feature “” --license “”
Ignoring license option: – using GPLv2+CE by default
install-jdk.sh 2019-07-06
Expected feature release number in range of 9 to 14, but got:
The command “~/bin/install-jdk.sh --target “/home/travis/zulu8.38.0.13-ca-fx-jdk8.0.212” --workspace “/home/travis/.cache/install-jdk” --feature “” --license “”” failed and exited with 3 during .
Your build has been stopped.
rsabhi
July 15, 2019, 4:11am
10
Hi sormuras,
Could you please suggest the error I have pointed out? Does it still works for zulu8.38.0.13-ca-fx-jdk8.0.212? I am getting error, Installing zulu8.38.0.13-ca-fx-jdk8.0.212
$ export JAVA_HOME=~/zulu8.38.0.13-ca-fx-jdk8.0.212
$ export PATH="$JAVA_HOME/bin:$PATH"
$ ~/bin/install-jdk.sh --target “/home/travis/zulu8.38.0.13-ca-fx-jdk8.0.212” --workspace “/home/travis/.cache/install-jdk” --feature “” --license “”
Looks like no valid feature (and license) argument is passed: --feature “” --license “”
It seems there’s a mix of different install-jdk.sh
scripts active. Strange…
Please compare your .travis.yml
configuration with this one: https://travis-ci.org/sormuras/sormuras.github.io/jobs/555982983/config