Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to define a JAVA_HOME variable for each installation #337

Closed
2 of 5 tasks
laeubi opened this issue Jun 4, 2022 · 8 comments
Closed
2 of 5 tasks

Allow to define a JAVA_HOME variable for each installation #337

laeubi opened this issue Jun 4, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@laeubi
Copy link

laeubi commented Jun 4, 2022

Description:

We have a setup where we need different JVM versions in parallel, for that we call the setup step multiple times and setup later a toolchain using the env variables. This works fine for Java 11 / 17 but with java 18 it produces a JAVA_HOME_8X64 instead of JAVA_HOME18_X64

Task version:
v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
You can find a run here: https://github.com/eclipse/tycho/runs/6737378073
If you open the "Build Tycho" step, there is a list of env variables and one can see the following ones:

Expected behavior:
I want to see an env variable named JAVA_HOME_18_X64

Actual behavior:
I see an env variable JAVA_HOME_8_X64 is created instead

@dmitry-shibanov
Copy link
Contributor

Hello @laeubi. Thank you for your report. The action does not produce such kind of env variable. It produces only JAVA_HOME.

@laeubi
Copy link
Author

laeubi commented Jun 4, 2022

@dmitry-shibanov so who is setting the variable then? I can only tell that adding this action makes both variables aviable JAVA_HOME and JAVA_HOME_<version>_<arch>.

@laeubi
Copy link
Author

laeubi commented Jun 4, 2022

By the way this was mentioned here:

@dmitry-shibanov
Copy link
Contributor

@laeubi I've printed env variables by pattern JAVA_HOME*. Only the JAVA_HOME env variable is changed.

@laeubi
Copy link
Author

laeubi commented Jun 4, 2022

@dmitry-shibanov first this is what I mean:

grafik

so somehow it is added but I have no idea why (maybe as result of tool install?) :-)

Only the JAVA_HOME env variable is changed.

Maybe the action can then be changed to explicitly set those variables? This is incredible useful for such purposes where one needs many JVMs in the same run...

@dmitry-shibanov
Copy link
Contributor

@laeubi The JAVA_HOME_* env variables are created during image generation here. The action does not modify them.

@laeubi
Copy link
Author

laeubi commented Jun 4, 2022

It seems in (older) versions of the script, they where also produced (or overridden) by the setup action:

let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch;
core.exportVariable('JAVA_HOME', toolPath);
core.exportVariable(extendedJavaHome, toolPath);
core.addPath(path.join(toolPath, 'bin'));

do you think such a feature could be added back? Maybe even by make the env variable configurable and defaulting to JAVA_HOME?

@laeubi laeubi changed the title Using Java 18 produces a JAVA_HOME_8_X64 env variable Allow to define a JAVA_HOME variable for each installation Jun 5, 2022
@laeubi
Copy link
Author

laeubi commented Jun 5, 2022

Duplicate of #44

@laeubi laeubi closed this as completed Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants