SeemaC
SeemaC

Reputation: 5

JAVA_HOME environment variable missing in github actions runner

I am trying to run java setup and then lein setup, where java setup run successfully.

We are getting problem to run java required next step.

- name: Set up JDK 17     
  uses: actions/setup-java@v4
  with:
        java-version: '17'
        distribution: 'temurin'
- name: Use oxr463/setup-leiningen  // this step needs java 
  uses: oxr463/[email protected]
  with:
    exec: |
          lein uberjar && \
          cp "$(find . -name '*.jar')" .

Error at after the workflow run :

/usr/local/bin/lein: line 224: type: java: not found

Leiningen couldn't find 'java' executable, which is required.

Please either set JAVA_CMD or put java (>=1.6) in your $PATH (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin).

/usr/local/bin/lein: line 224: type: java: not found

Leiningen couldn't find 'java' executable, which is required.

Please either set JAVA_CMD or put java (>=1.6) in your $PATH (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin).

Am I missing any step? Please do suggest the solution.

Upvotes: 0

Views: 260

Answers (1)

Superman
Superman

Reputation: 462

Try setting the JAVA_CMD environment variable to the path of the Java executable. This might help Leiningen locate the Java installation.

env:
          JAVA_CMD: $(which java)  # Set JAVA_CMD to the path of the Java executable

Upvotes: 0

Related Questions