You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add output parameter with path to installed JDK #65
When calling the action several times, it will overwrite the JAVA_HOME environment variable and prepend it to the PATH, effectively shadowing a previous run of the action.
Fortunately, it will also set a JAVA_HOME_<version>_<architecture> environment variable, but this could be more idiomatic as an output parameter (in addition to the environment variable, which can also be useful on its own: #44 (comment))
- name: Setup JDK 11id: setup-java-11uses: actions/setup-java@v1with:
java-version: 11# here with #21, one would disable "installation"
- name: Setup JDK 14id: setup-java-14uses: actions/setup-java@v1with:
java-version: 14# here with #21, one would disable "installation"
- name: Setup JDK 8# Ran last due each run shadowing the previous ones; see also #21uses: actions/setup-java@v1with:
java-version: 8
- name: Build and run tests (with JDK 8)run: ./gradlew build
- name: Run tests with JDK 11run: ./gradlew test -Ptest.jdk-path="${{ steps.setup-java-11.outputs.jdk-path }}"
- name: Run tests with JDK 14run: ./gradlew test -Ptest.jdk-path="${{ steps.setup-java-14.outputs.jdk-path }}"
(here, the build is still running with JDK 8, but it coud configure its tests to actually use another JDK)
This is actually worse than that: java-version: 11 won't actually set JAVA_HOME_11_x64, but JAVA_HOME_11.0.7_x64, making that variable essentially useless as its name will actually change whenever a new version of the JDK is released.
As a workaround, I'm using (with a previous call with java-version: 11 and a previous Gradle build with JDK 11: the new build here still runs with JDK 11 so it won't recompile Java sources)
Activity
tbroyer commentedon May 24, 2020
This is actually worse than that:
java-version: 11won't actually setJAVA_HOME_11_x64, butJAVA_HOME_11.0.7_x64, making that variable essentially useless as its name will actually change whenever a new version of the JDK is released.As a workaround, I'm using (with a previous call with
java-version: 11and a previous Gradle build with JDK 11: the new build here still runs with JDK 11 so it won't recompile Java sources)I could have used a
::set-envtoo of course to setJAVA_HOME_11_x64.Add output parameters for the tool path and version
Add output parameters for the tool path and version
Add output parameters for the tool path and version
Add output parameters for the tool path and version
Add output parameters for the tool path and version
Ryan9Manu commentedon Oct 18, 2022
Nmnbbb
Ryan9Manu commentedon Oct 18, 2022
Bjjk
Ryan9Manu commentedon Oct 18, 2022
Bnnk no nn
Add output parameters for the tool path and version