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.

Allow custom target directory for exploding `jdkFile` into

See original GitHub issue

Description: Introduce an optional input for specifying a custom target directory for exploding a jdkFile into.

Justification: Installing multiple JDKs that share the same JDK feature release number (like 19) is not possible at the moment.

For example, after downloading two JDK archives that both are based on JDK 19, the second run of setup-java@v3 detects that a Java 19 is already installed and uses it; instead of extracting the second JDK archive into a new and different directory:

    - name: 'Install custom JDK 19'
      uses: actions/setup-java@v3
      with:
        distribution: jdkfile
        jdkFile: .../openjdk-19-jextract+2-3_linux-x64_bin.tar.gz
        java-version: 19.0.0+0-jextract

    - name: 'Install full JDK 19'
      uses: actions/setup-java@v3
      with:
        distribution: jdkfile
        jdkFile: .../openjdk-19-ea+33_linux-x64_bin.tar.gz
        java-version: 19

The output of the second run reads like:

Run actions/setup-java@v3
  with:
    java-version: 19
    distribution: jdkfile
    jdkFile: .../openjdk-19-ea+33_linux-x64_bin.tar.gz
    java-package: jdk
    architecture: x64
    check-latest: false
    server-id: github
    server-username: GITHUB_ACTOR
    server-password: GITHUB_TOKEN
    overwrite-settings: true
    job-status: success
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_jdkfile_jdk/19.0.0-0-jextract/x64
Resolved Java 19.0.0+0-jextract from tool-cache
Setting Java 19.0.0+0-jextract as default

Expectation:

With a custom target directory specified for each run (openjdk-19-jextract+2-3 and openjdk-19-ea+33), there would be two dedicated JDK installations. Like:

  • /opt/hostedtoolcache/Java_jdkfile_jdk/openjdk-19-jextract+2-3/x64
  • /opt/hostedtoolcache/Java_jdkfile_jdk/openjdk-19-ea+33/x64

Work-around: Pass fake values to java-version in order to generated dedicated target directories. See https://github.com/oracle-actions/setup-java/issues/34 for details.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sormurascommented, Aug 8, 2022

In fact, it does work already today, when choosing valid (SemVer-wise) but weird values like: 0 or 123 or Math.abs("abc...xyz".hashCode()). Yet, the output of which Java version is installed reads … weird:

Java 862414701 was not found in tool-cache. Trying to unpack JDK file...Setting Java 862414701 as default

Java configuration:
 Distribution: jdkfile
 Version: 862414701
 Path: /opt/hostedtoolcache/Java_jdkfile_jdk/862414701/x64

If input java-version would allow arbitrary (legal, file system-wise) values in jdkFile mode, it would help both cases, I guess.

0reactions
denismakogoncommented, Aug 23, 2022

@dsame I’m deeply sorry, but what Christian provided isn’t a “solution” but a workaround we have come up with.

You’re closing this because of what? What motivates you to leave “an elephant in a room” (a bug in setup-java action)? You really think that this is how it should work? I’m sorry to say but that’s not a technical conclusion rather than an attempt to avoid the decisions that action doesn’t work as it should be.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven: specify the outputDirectory only for packaging a jar?
Now, the output directory is set via the property from the command line (using -Ddir=somedirectory ). Downside: now you always have to use ......
Read more >
jdk/jdk: ee1d592a9f53 doc/building.md
From time to time, this is updated by contributors to list successes or ... The output of the exploded image resides in `$BUILD/jdk`....
Read more >
Microcontainer User Guide - Red Hat Customer Portal
This guide is intended for Java developers who wish to use the JBoss Microcontainer to deploy customized, modular Java environments for their applications....
Read more >
Gradle User Guide - gvSIG Association
execution, Gradle allows you to monitor and customize its configuration and execution behavior to its very core. Gradle scales. Gradle scales very well....
Read more >
[SOLVED] Maven: Set target/output directory
Hello. I want to set the target/output directory for my maven build. I searched on the internet for over an hour, but I...
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