Closed x80486 closed 4 years ago
I am seeing this behavior as well. I changed my ~/.tool-versions
file from java adoptopenjdk-8.212
to java adopt-openjdk-8u212-b03
and that seemed to solve this issue.
It seems that it didn't download sapmachine.json
,so I got in ~/.asdf/plugins/java/bin/list-all
to have a look.
Saw line 65, 80, 81, it needs to download https://api.github.com/repos/SAP/SapMachine/releases
, and process json it downloaded.
But it seems that line 80 not executed successfully:
curl "${github_curl_opts[@]}" "${url}" -o "${CACHE_DIR}/sapmachine.json" > /dev/null 2>&1
may be caused of
local github_curl_opts=("${CURL_OPTS[@]}" '-H' "Authorization: token $GITHUB_API_TOKEN")
I haven't set the GITHUB_API_TOKEN
variable to let it work at all.
To get a token (don't know how) or it seems not needed in a rarely usage case, so:
# edit it out:
local github_curl_opts=("${CURL_OPTS[@]}" '-H' "Authorization: token $GITHUB_API_TOKEN")
# to:
local github_curl_opts=("${CURL_OPTS[@]}")
or workaround for myself:
# First, manually save `https://api.github.com/repos/SAP/SapMachine/releases` from Browser to `/tmp/asdf-java.cache/sapmachine.json`
# enter bash
source ~/.asdf/plugins/java/bin/list-all
# copy-paste code segment at line 81-100 in the file, to finish its json processing:
jq '[.[]
| select(.prerelease == false and .draft == false)
| {
release_name: .name,
binaries: [
.assets[]
| select(.content_type == "application/x-tar")
| select(.name | startswith("sapmachine-jdk"))
| select(.name | endswith("linux-x64_bin.tar.gz") or endswith("osx-x64_bin.tar.gz"))
| {
package: {
link: .browser_download_url,
checksum_link: (.browser_download_url | sub("tar\\.gz$"; "sha256.txt"))
},
os: (if .name | endswith("osx-x64_bin.tar.gz") then "mac" else "linux" end),
architecture: "x64",
jvm_impl: "hotspot",
heap_size: "normal"
}]}]' "${CACHE_DIR}/sapmachine.json" > "${CACHE_DIR}/sapmachine.temp"
mv "${CACHE_DIR}"/sapmachine.temp "${CACHE_DIR}"/sapmachine.json
This should be solved by merging #87:
# asdf list-all java | grep ^sapm
sapmachine-11.0.6
sapmachine-11.0.6.0.1
sapmachine-11.0.7
sapmachine-13.0.2
sapmachine-14
sapmachine-14.0.1
Fixed via #87
There is something going on with SAP Machine builds (or something like that):
Also, isn't weird that the list is split for
adopt-openjdk
?