0

I am using retrolambda in my Android application, and using circleci.com as continuous integration for my github repo.

the problem is I have configured my local mac environment for Java_Home and Java7_Home, and everything is okay, but I don't know how to config circleci yml file for this problem.

here is my application repo:

https://github.com/mmirhoseini/weather_app

here is my local configurations on .bash_profile file:

export JAVA_HOME=`/usr/libexec/java_home`
export JAVA7_HOME=`/usr/libexec/java_home -v 1.7`

this is my circleci.yml file:

#
# Build configuration for Circle CI
#

general:
    artifacts:
        - /home/ubuntu/weather_app/app/build/outputs/apk/

machine:
    environment:
        ANDROID_HOME: /usr/local/android-sdk-linux

    java:
      version: openjdk8

dependencies:
    override:
        - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.3,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
        - ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies

test:
    override:
        - (./gradlew assemble):
            timeout: 360

        - (./gradlew test):
            timeout: 360

and here is the circleci error log:

> Building 10%When running gradle with java 8, you must set the path to the old jdk, either with property retrolambda.oldJdk or environment variable JAVA5_HOME/JAVA6_HOME/JAVA7_HOME

please help...

Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148
Mohsen Mirhoseini
  • 8,454
  • 5
  • 34
  • 59
  • 1
    Did you refer this link https://github.com/evant/gradle-retrolambda/blob/master/README.md#configuration – prashant thakre May 26 '16 at 08:40
  • as I mentioned, I have configured my local environment and everything is okay locally, the problem is when I am using circleci and I don't know how to configure that machine using yml file. – Mohsen Mirhoseini May 26 '16 at 08:56

1 Answers1

1

finally problem solved, I prepared environment by downloading older java version and setting Java6_home and after that build and run my tests.

here is my circleci.yml file:

#
# Build configuration for Circle CI
#

general:
    artifacts:
        - /home/ubuntu/weather_app/app/build/outputs/apk/
        - /usr/lib/jvm/

machine:
    environment:
        ANDROID_HOME: /usr/local/android-sdk-linux
        JAVA6_HOME: /usr/lib/jvm/java-6-openjdk-amd64

    java:
      version: openjdk8

dependencies:
    override:
        - echo y | sudo apt-get update
        - echo y | sudo apt-get install libpango-1.0-0
        - echo y | sudo apt-get install openjdk-6-jre

        - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.3,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support
        - ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies

test:
    override:
        - (./gradlew assemble):
            timeout: 360

        - (./gradlew test):
            timeout: 360
Mohsen Mirhoseini
  • 8,454
  • 5
  • 34
  • 59