GithubHelp home page GithubHelp logo

Comments (10)

marc0der avatar marc0der commented on September 28, 2024

Hi @nibocn, so it seems like the binary is downloaded successfully, but the internal structure might be a bit funky.
I tried installing this on my Linux machine, but that binary has no issues. I don't have a Mac, but maybe @eddumelendez can see if the macOS binary is compliant.

from sdkman-disco-integration.

eddumelendez avatar eddumelendez commented on September 28, 2024

Sorry for the delay. No issues installing on M1.

from sdkman-disco-integration.

nibocn avatar nibocn commented on September 28, 2024

I also find it strange because after that, I was able to install it successfully using Liberica. My current approach is to use Liberica for installation, which works in most cases. However, when I need Liberica NIK, I install it manually. This is how I have temporarily resolved the issue.

My current version of SDKMAN:
SDKMAN!
script: 5.18.1
native: 0.2.9

image

from sdkman-disco-integration.

eddumelendez avatar eddumelendez commented on September 28, 2024

Did you try again with sdkman? If no, can you try, please?

from sdkman-disco-integration.

nibocn avatar nibocn commented on September 28, 2024

from sdkman-disco-integration.

eddumelendez avatar eddumelendez commented on September 28, 2024

what about running sdk flush first and then trying to install again?

from sdkman-disco-integration.

nibocn avatar nibocn commented on September 28, 2024

what about running sdk flush first and then trying to install again?

Yes, I ran the sdk flush command, but I am still encountering the same error when downloading java 22.3.2.r17-nik.

Downloading: java 22.3.2.r17-nik

In progress...

########################################################################################################################################## 100.0%
Download has failed, aborting!

Can not install java 22.3.2.r17-nik at this time...

Then I also downloaded java 20.0.1-librca and it was successful. I checked the generated related files in the ~/.sdkman/tmp directory, and the specific details are as follows:

image

hook_post_java_22.3.2.r17-nik.sh file:

#!/bin/bash
#Post Hook: osx-java-tarball
function __sdkman_post_installation_hook {
    __sdkman_echo_debug "A macOS 64bit post-install hook was found for Java 22.3.2.r17-nik-openjdk."

     __sdkman_validate_binary_input "$binary_input" || return 1

    local present_dir="$(pwd)"
    local work_dir="${SDKMAN_DIR}/tmp/out"
    local work_jdk_dir="${SDKMAN_DIR}/tmp/Java-22.3.2.r17-nik"

    echo ""
    __sdkman_echo_green "Repackaging Java 22.3.2.r17-nik..."

    mkdir -p "$work_dir"
    /usr/bin/env tar zxf "$binary_input" -C "$work_dir"

    cd "$work_dir"/*/Contents
    mv -f Home "$work_jdk_dir"
    cd "${SDKMAN_DIR}"/tmp
    /usr/bin/env zip -qyr "$zip_output" "Java-22.3.2.r17-nik"
    cd "$present_dir"

    echo ""
    __sdkman_echo_green "Done repackaging..."

    __sdkman_echo_green "Cleaning up residual files..."
    rm -f "$binary_input"
    rm -rf "$work_dir"
    rm -rf "$work_jdk_dir"
}

function __sdkman_validate_binary_input {
    if ! tar tzf "$1" &> /dev/null; then
        echo "Download has failed, aborting!"
        echo ""
        echo "Can not install java 22.3.2.r17-nik at this time..."
        return 1
    fi
}

hook_post_java_20.0.1-librca.sh file:

#!/bin/bash
#Post Hook: default-zip
function __sdkman_post_installation_hook {
    __sdkman_echo_debug "No macOS 64bit post-install hook found for Java 20.0.1-librca."
    __sdkman_echo_debug "Moving $binary_input to $zip_output"
    mv -f "$binary_input" "$zip_output"
}

java-22.3.2.r17-nik.headers.tmp file:

HTTP/1.1 200 Connection established

HTTP/1.1 302 Found
Server: nginx/1.19.10
Date: Thu, 06 Jul 2023 09:31:33 GMT
Content-Length: 0
Connection: keep-alive
X-Sdkman-ArchiveType: zip
location: https://download.bell-sw.com/vm/22.3.2/bellsoft-liberica-vm-openjdk17.0.7+7-22.3.2+1-macos-amd64.zip

HTTP/1.1 200 Connection established

HTTP/2 200 
date: Thu, 06 Jul 2023 09:31:34 GMT
content-type: application/zip
content-length: 303579959
x-content-type-options: nosniff
content-security-policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
x-xss-protection: 1; mode=block
last-modified: Wed, 26 Apr 2023 08:16:05 GMT
content-disposition: inline
cache-control: public, max-age=2592000
cf-cache-status: HIT
expires: Sat, 05 Aug 2023 09:31:34 GMT
accept-ranges: bytes
server: cloudflare
cf-ray: 7e26d5e1ef5b0443-HKG

java-20.0.1-librca.headers.tmp file:

HTTP/1.1 200 Connection established

HTTP/1.1 302 Found
Server: nginx/1.19.10
Date: Thu, 06 Jul 2023 09:32:44 GMT
Content-Length: 0
Connection: keep-alive
X-Sdkman-ArchiveType: zip
location: https://github.com/bell-sw/Liberica/releases/download/20.0.1+10/bellsoft-jdk20.0.1+10-macos-amd64.zip

HTTP/1.1 200 Connection established

HTTP/2 302 
server: GitHub.com
date: Thu, 06 Jul 2023 09:32:44 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With
location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/115621629/744a56bd-66b6-4b08-a7d0-141c72d4491e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230706%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230706T093244Z&X-Amz-Expires=300&X-Amz-Signature=2ecc70ca8c015412258b12391aa27d49778e16fdcc96b0a3a26183f56a2adadd&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=115621629&response-content-disposition=attachment%3B%20filename%3Dbellsoft-jdk20.0.1%2B10-macos-amd64.zip&response-content-type=application%2Foctet-stream
cache-control: no-cache
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com objects-origin.githubusercontent.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com cdn.optimizely.com logx.optimizely.com/v1/events *.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ wss://*.actions.githubusercontent.com github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com objects-origin.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; worker-src github.com/assets-cdn/worker/ gist.github.com/assets-cdn/worker/
content-length: 0
x-github-request-id: B33D:1BBE:917BE9:98F9B3:64A68A3C

HTTP/1.1 200 Connection established

HTTP/2 200 
content-type: application/octet-stream
content-md5: Yo4BHJKl6xyqc25aFZoOkA==
last-modified: Fri, 14 Apr 2023 00:20:51 GMT
etag: "0x8DB3C7E1A6DD7E9"
server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: 691bf428-901e-004a-28ec-af42da000000
x-ms-version: 2020-04-08
x-ms-creation-time: Fri, 14 Apr 2023 00:20:51 GMT
x-ms-lease-status: unlocked
x-ms-lease-state: available
x-ms-blob-type: BlockBlob
content-disposition: attachment; filename=bellsoft-jdk20.0.1+10-macos-amd64.zip
x-ms-server-encrypted: true
via: 1.1 varnish, 1.1 varnish
fastly-restarts: 1
accept-ranges: bytes
age: 0
date: Thu, 06 Jul 2023 09:32:45 GMT
x-served-by: cache-iad-kcgs7200116-IAD, cache-hkg17923-HKG
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1688635965.009654,VS0,VE497
content-length: 218198043

I don't know if this information will be of any help. The hook_post_java_22.3.2.r17-nik.sh script indeed has some judgements regarding the file type. In addition, there are some differences between the java-22.3.2.r17-nik.headers.tmp file and java-20.0.1-librca.headers.tmp file.

from sdkman-disco-integration.

eddumelendez avatar eddumelendez commented on September 28, 2024

20.0.1-librca was installed sucessfully? Do you only have issues with Liberica NIK?

from sdkman-disco-integration.

nibocn avatar nibocn commented on September 28, 2024

20.0.1-librca was installed sucessfully? Do you only have issues with Liberica NIK?

Yes, currently it has been found that there are issues with "Liberica NIK," but "Liberica" and "Java.net" are both working successfully.

image

from sdkman-disco-integration.

eddumelendez avatar eddumelendez commented on September 28, 2024

I was able to run it and install it sucessfully

▶ cat ~/.sdkman/tmp/hook_post_java_22.3.2.r17-nik.sh
#!/bin/bash
#Post Hook: osx-java-tarball
function __sdkman_post_installation_hook {
    __sdkman_echo_debug "A macOS 64bit post-install hook was found for Java 22.3.2.r17-nik-openjdk."

     __sdkman_validate_binary_input "$binary_input" || return 1

    local present_dir="$(pwd)"
    local work_dir="${SDKMAN_DIR}/tmp/out"
    local work_jdk_dir="${SDKMAN_DIR}/tmp/Java-22.3.2.r17-nik"

    echo ""
    __sdkman_echo_green "Repackaging Java 22.3.2.r17-nik..."

    mkdir -p "$work_dir"
    /usr/bin/env tar zxf "$binary_input" -C "$work_dir"

    cd "$work_dir"/*/Contents
    mv -f Home "$work_jdk_dir"
    cd "${SDKMAN_DIR}"/tmp
    /usr/bin/env zip -qyr "$zip_output" "Java-22.3.2.r17-nik"
    cd "$present_dir"

    echo ""
    __sdkman_echo_green "Done repackaging..."

    __sdkman_echo_green "Cleaning up residual files..."
    rm -f "$binary_input"
    rm -rf "$work_dir"
    rm -rf "$work_jdk_dir"
}

function __sdkman_validate_binary_input {
    if ! tar tzf "$1" &> /dev/null; then
        echo "Download has failed, aborting!"
        echo ""
        echo "Can not install java 22.3.2.r17-nik at this time..."
        return 1
    fi
}

~/Downloads/git
▶ cat ~/.sdkman/tmp/java-22.3.2.r17-nik.headers.tmp
HTTP/1.1 302 Found
Server: nginx/1.19.10
Date: Thu, 06 Jul 2023 10:06:24 GMT
Content-Length: 0
Connection: keep-alive
X-Sdkman-ArchiveType: zip
location: https://download.bell-sw.com/vm/22.3.2/bellsoft-liberica-vm-openjdk17.0.7+7-22.3.2+1-macos-amd64.zip

HTTP/2 200
date: Thu, 06 Jul 2023 10:06:25 GMT
content-type: application/zip
content-length: 303579959
x-content-type-options: nosniff
content-security-policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
x-xss-protection: 1; mode=block
last-modified: Wed, 26 Apr 2023 08:16:05 GMT
content-disposition: inline
cache-control: public, max-age=2592000
cf-cache-status: MISS
expires: Sat, 05 Aug 2023 10:06:25 GMT
accept-ranges: bytes
server: cloudflare
cf-ray: 7e2708ec5ba2aa07-DFW

I'm closing this as no reproducible.

from sdkman-disco-integration.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.