question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multiple JDKs during build

See original GitHub issue

Certain projects might require multiple JDKs during build (e.g., Apache Log4j requires Java 7 and Java 9+ by means of toolchains.xml) and in its current form, that is not possible via setup-java.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:29
  • Comments:25 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
mprinscommented, Jan 7, 2021
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
  with:
    java-version: ${{ matrix.java-version }}

No, this only installs 1 java version for one build, not multiple java versions for 1 build

3reactions
laeubicommented, Jun 5, 2022

and configure in toolchains.xml

There is even a PR for this already, would be cool if it could be merged: https://github.com/actions/setup-java/pull/282

I ended up going with is adding an additional input parameter to the action used to specify the “target” environment variable/s with the following semantics:

* If the target is not specified explicitly, only `JAVA_HOME` is set to point to the JDK.

* If the target is specified explicitly, it is interpreted as a `;` separated list of environment variables that will be set to point to the JDK. (`JAVA_HOME` is **not** set to point to the JDK unless the input explicitly contains `JAVA_HOME`.)

Naturally, this makes it incredibly easy to work with multiple JDK versions since their locations could simply be pointed to by separate environment variables

This sounds really useful do you think you can open a PR?

@dmitry-shibanov any chance this could be implemented soon or a PR being accepted for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage Multiple JDKs on Mac OS, Linux and Windows WSL2
Manage Multiple JDKs with jEnv · Set a Java version for your overall system. · Set a Java version for the current directory/project...
Read more >
How build multiple projects with gradle with multiple jdk ...
Toolchains allow to define a JDK version to be used to compile/run a project, that is a JDK different than the one running...
Read more >
Support for multiple JDKs - The Travis CI Blog
Today we are happy to announce support for multiple JDKs!!! This will work for Clojure, Groovy, Java, Ruby and Scala. We hope this...
Read more >
Managing Multiple JDK Installations With jEnv - Reflectoring
jEnv is a handy tool to manage multiple JDK versions between different projects. With jenv local <version> we can configure a JDK version...
Read more >
How to set several JDK versions to be installed on demand
If we have jobs that need to be built using different JDK versions, you would need to have these JDKs installed in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found