Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Maven Toolchains: clarify tool JDK setup #835

Copy link
Copy link
@stechio

Description

@stechio
Issue body actions

I need to run Maven under JDK 17, while building source code under JDK 11.

The documentation explains how to set up the toolchain, but doesn't seem to indicate how to specify the JDK under which Maven itself has to run.

Could you please clarify the proper way to specify the JDK (in my case, 17) for running Maven, as I select multiple JDKs for toolchain? Do I have to explicitly set JAVA_HOME after selecting the JDKs? What else?

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-java@v4
      with:
        distribution: 'temurin'
        java-version: |
          11
          17

    # How do I make `mvn` run under JDK 17?
    # Is there a declarative statement to add?
    # Do I have to explicitly set `JAVA_HOME`?
    # What else?

    - name: Build with Maven
      run: mvn -B package --file pom.xml
Reactions are currently unavailable

Metadata

Metadata

Labels

bugSomething isn't workingSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.