__sdkman_post_installation_hook: command not found
alex-popov-tech opened this issue ยท 24 comments
Hi guys.
I'm new one with SDKMAN, and when trying to pull java using
sdk install java 8u141-oracle
see error after downloading
$ sdk install java 8u141-oracle
Oracle requires that you agree with the Oracle Binary Code License Agreement
prior to installation. The license agreement can be found at:
http://www.oracle.com/technetwork/java/javase/terms/license/index.html
Do you agree to the terms of this agreement? (Y/n): y
Downloading: java 8u141-oracle
In progress...
######################################################################## 100.0%
bash: __sdkman_post_installation_hook: command not found
using windows 10, git bash. Can someone please help me figure out?
Hi, and thank you for reporting this bug. The actual behaviour that we would be expecting from Git Bash is that installation of Oracle JDK should have been blocked from the outset. You can read all about in this article.
Could I ask you to please paste the output of the uname
command in your shell? This will help me to make sure that your scenario is covered when fixing this issue.
I would also like to ask you to help testing this once I have fixed this. Would you be willing help?
@AleksanderPopov I've released a fix on the serverside, making the assumption that your git bash shell has a uname like MINGW64_NT-6.3
. Can you give it a test now and let me know what happens when you attempt installation?
Forgot to mention that if you want to use a JDK in a shell other than Cygwin you will need to stick with the OpenJDK. Unfortunately the Oracle JDK is only supported in Cygwin shells.
Let me know how that goes.
@marc0der uname - MINGW64_NT-10.0
Sure, i can help with testing. Can you please provide steps which i need to perform to ensure, that all works properly?
@marc0der tests on Cygwin:
oracle jdk output:
$ sdk install java 8u141-oracle
Oracle requires that you agree with the Oracle Binary Code License Agreement
prior to installation. The license agreement can be found at:
http://www.oracle.com/technetwork/java/javase/terms/license/index.html
Do you agree to the terms of this agreement? (Y/n): y
Downloading: java 8u141-oracle
In progress...
######################################################################## 100.0%
Repackaging Java 8u141-oracle...
mv: cannot move '/cygdrive/c/temp/jdk' to '/home/Alex/.sdkman/tmp/out/jdk': Directory not empty
Done repackaging...
mv: cannot stat '/home/Alex/.sdkman/tmp/rN2je0FM6edmPUy8GF2TN6cuWCjJDuLX.zip': No such file or directory
unzip: cannot find or open /home/Alex/.sdkman/archives/java-8u141-oracle.zip, /home/Alex/.sdkman/archives/java-8u141-oracle.zip.zip or / home/Alex/.sdkman/archives/java-8u141-oracle.zip.ZIP.
rm: cannot remove '/home/Alex/.sdkman/archives/java-8u141-oracle.zip': No such file or directory
Stop! The archive was corrupt and has been removed! Please try installing again.
zulu jdk:
$ sdk install java 8u131-zulu
Downloading: java 8u131-zulu
In progress...
######################################################################## 100.0%
Installing: java 8u131-zulu
Done installing!
Setting java 8u131-zulu as default.
@marc0der is it correct behavior?
Hi @AleksanderPopov sorry, maybe I was a bit unclear. The bug you reported was for MinGW (git bash), so will you try testing both cases on Git Bash for me please?
Not sure what went wrong in that Cygwin shell, but almost seems like you don't have zip installed?
I've tested this with MinGW and Cygwin and all seems to work fine now. Closing this issue.
I have the same problem, what ever when I install grade or maven. After downloading, it says "__sdkman_post_installation_hook: command not found".
I am using Ubuntu X64 version 17.10, uname shows "Linux". I got here by google.
Thanks for your help.
java 8.0.202.j9-adpt
and 8.0.202.hs-adpt
and 8.0.202-amzn
cannot install on msys2 on Windows 10.
Here is my output:
uname -a
MINGW64_NT-10.0 FJP-PC 2.11.2(0.329/5/3) 2018-11-26 09:22 x86_64 Msys
sdk i java 8.0.202.j9-adpt
Downloading: java 8.0.202.j9-adpt
In progress...
######################################################################## 100.0%
-bash: __sdkman_post_installation_hook: command not found
@abcfy2 Would you mind enabling debug mode so we can see what the output is please?
Also, if you could give us the output of the uname command would be very helpful.
@marc0der Sure.
Here is uname
output:
$ uname -a
MINGW64_NT-10.0 FJP-PC 2.11.2(0.329/5/3) 2018-11-26 09:22 x86_64 Msys
$ uname
MINGW64_NT-10.0
$ sdk i java 8.0.202.j9-adpt
==== BROADCAST =================================================================
* 2019-02-19: Grails 4.0.0.M1 released on SDKMAN! #grailsfw
* 2019-02-16: Kscript 2.7.0 released on SDKMAN! #kscript
* 2019-02-15: Leiningen 2.9.0 released on SDKMAN! #leiningen
================================================================================
Validate java 8.0.202.j9-adpt for MINGW64_NT-10.0: valid
Validation URL: https://api.sdkman.io/2/candidates/validate/java/8.0.202.j9-adpt/mingw64_nt-10.0
Get pre-installation hook: https://api.sdkman.io/2/hooks/pre/java/8.0.202.j9-adpt/mingw64_nt-10.0
Copy remote pre-installation hook: /c/Users/abcfy/.sdkman/tmp/hook_pre_java_8.0.202.j9-adpt.sh
No MinGW pre-install hook found for Java 8.0.202.j9-adpt.
Completed pre-installation hook...
Downloading: java 8.0.202.j9-adpt
In progress...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 650 0 650 0 0 189 0 --:--:-- 0:00:03 --:--:-- 380
100 111M 100 111M 0 0 854k 0 0:02:13 0:02:13 --:--:-- 896k
Downloaded binary to: /c/Users/abcfy/.sdkman/tmp/7ePN789pqdXxVTwkRj0HqFGulMB1LQ4J.bin
Get post-installation hook: https://api.sdkman.io/2/hooks/post/java/8.0.202.j9-adpt/mingw64_nt-10.0
Copy remote pre-installation hook: /c/Users/abcfy/.sdkman/tmp/hook_pre_java_8.0.202.j9-adpt.sh
-bash: __sdkman_post_installation_hook: command not found
And I find the ${SDKMAN_DIR}/tmp/hook_post_java_8.0.202.j9-adpt.sh
is empty:
$ cat /c/Users/abcfy/.sdkman/tmp/hook_post_java_8.0.202.j9-adpt.sh
... empty here ...
And also, I find the post-installation hook URL returns 404
:
$ curl -v https://api.sdkman.io/2/hooks/post/java/8.0.202.j9-adpt/mingw64_nt-10.0
* Trying 159.89.187.78...
* Connected to api.sdkman.io (159.89.187.78) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 592 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: *.sdkman.io (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: OU=Domain Control Validated,OU=EssentialSSL Wildcard,CN=*.sdkman.io
* start date: Sun, 29 Apr 2018 00:00:00 GMT
* expire date: Tue, 28 Apr 2020 23:59:59 GMT
* issuer: C=GB,ST=Greater Manchester,L=Salford,O=COMODO CA Limited,CN=COMODO RSA Domain Validation Secure Server CA
* compression: NULL
* ALPN, server accepted to use http/1.1
> GET /2/hooks/post/java/8.0.202.j9-adpt/mingw64_nt-10.0 HTTP/1.1
> Host: api.sdkman.io
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Server: nginx/1.13.12
< Date: Wed, 20 Feb 2019 12:45:00 GMT
< Content-Length: 0
< Connection: keep-alive
<
* Connection #0 to host api.sdkman.io left intact
Of course, 8.0.202-amzn
and 8.0.202.hs-adpt
also return 404
.
But 8.0.202-zulu
works very well:
$ curl -v https://api.sdkman.io/2/hooks/post/java/8.0.202-zulu/mingw64_nt-10.0
* Trying 159.89.187.78...
* Connected to api.sdkman.io (159.89.187.78) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 592 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: *.sdkman.io (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: OU=Domain Control Validated,OU=EssentialSSL Wildcard,CN=*.sdkman.io
* start date: Sun, 29 Apr 2018 00:00:00 GMT
* expire date: Tue, 28 Apr 2020 23:59:59 GMT
* issuer: C=GB,ST=Greater Manchester,L=Salford,O=COMODO CA Limited,CN=COMODO RSA Domain Validation Secure Server CA
* compression: NULL
* ALPN, server accepted to use http/1.1
> GET /2/hooks/post/java/8.0.202-zulu/mingw64_nt-10.0 HTTP/1.1
> Host: api.sdkman.io
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.13.12
< Date: Wed, 20 Feb 2019 12:49:53 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 261
< Connection: keep-alive
<
#!/bin/bash
#Post Hook: default-zip
function __sdkman_post_installation_hook {
__sdkman_echo_debug "No MinGW post-install hook found for Java 8.0.202-zulu."
__sdkman_echo_debug "Moving $binary_input to $zip_output"
mv "$binary_input" "$zip_output"
* Connection #0 to host api.sdkman.io left intact
}
Hi, I got the same issue, here is the result of uname -a
on codeanywhere.com vm container:
Linux HiJava 2.6.32-042stab112.15 #1 SMP Tue Oct 20 17:22:56 MSK 2015 x86_64 x86_64 x86_64 GNU/Linux
the HiJava
is just a name of project container.
@bitsnaps I just tried installing it on my Linux dev machine without any probs. Were you installing 8.0.202.j9-adpt
? If not, could it be that you are running /bin/sh
in your container?
@marc0der, I've just tried the free account at https://codeanywhere.com
, creating a new container -as far as I can remember- with ubuntu 16.04 and Oracle JDK8 with default settings, usually everything is ok in my local machine, I'm not sure about the config they use.
I use git-bash and uname
is MINGW64_NT-10.0
.
I got error __sdkman_post_installation_hook: command not found
with this command sdk install java 8.0.202.hs-adpt
.
I retried with option sdkman_debug_mode=true
, and got this.
# sdk install java 8.0.202.hs-adpt
Validate java 8.0.202.hs-adpt for MINGW64_NT-10.0: valid
Validation URL: https://api.sdkman.io/2/candidates/validate/java/8.0.202.hs-adpt/mingw64_nt-10.0
Get pre-installation hook: https://api.sdkman.io/2/hooks/pre/java/8.0.202.hs-adpt/mingw64_nt-10.0
Copy remote pre-installation hook: /c/Users/tenten0213/.sdkman/tmp/hook_pre_java_8.0.202.hs-adpt.sh
No MinGW pre-install hook found for Java 8.0.202.hs-adpt.
Completed pre-installation hook...
Downloading: java 8.0.202.hs-adpt
In progress...
############################################################################################################################################################################################ 100.0% Downloaded binary to:
/c/Users/tenten0213/.sdkman/tmp/tNTTr0kp0qrmZCnqS7VzpsBs5UE3ekcp.bin
Get post-installation hook: https://api.sdkman.io/2/hooks/post/java/8.0.202.hs-adpt/mingw64_nt-10.0
Copy remote pre-installation hook: /c/Users/tenten0213/.sdkman/tmp/hook_pre_java_8.0.202.hs-adpt.sh
/usr/bin/bash: __sdkman_post_installation_hook: command not found
--
As shown below, pre-install hook shell can not be obtained.
Get pre-installation hook: https://api.sdkman.io/2/hooks/pre/java/8.0.202.hs-adpt/mingw64_nt-10.0
Copy remote pre-installation hook: /c/Users/tenten0213/.sdkman/tmp/hook_pre_java_8.0.202.hs-adpt.sh
No MinGW pre-install hook found for Java 8.0.202.hs-adpt.
and I tried curl.
# curl -v -s -L https://api.sdkman.io/2/hooks/post/java/8.0.202.hs-adpt/mingw64_nt-10.0
< HTTP/1.1 404 Not Found
< Server: nginx/1.13.12
< Date: Mon, 25 Feb 2019 08:26:53 GMT
< Content-Length: 0
< Connection: keep-alive
j9-adpt and amzn is same.
but zulu is OK.
# curl -v -s -L https://api.sdkman.io/2/hooks/post/java/8.0.202-zulu/mingw64_nt-10.0
< HTTP/1.1 200 OK
< Server: nginx/1.13.12
< Date: Mon, 25 Feb 2019 08:34:02 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 261
< Connection: keep-alive
Is AdoptOpenJDK not supported in mingw?
I've made some fixes on the backend. @tenten0213 @bitsnaps @abcfy2 could you please confirm whether it is working for you now?
Also, it seems like we were having a similar issue with Corretto and SAP Machine which has also been resolved now.
@marc0der looks like fixed. Thanks, I was running on java version "1.8.0_181"
in that container which uses bash
as echo $SHELL
shown.
Thanks, this issue has been fixed.
Thanks. I could install it.
But since I found another problem, I will create an issue.
I found another problem
problem is resolved.
Git Bash (MINGW 64) can not create a symbolic link. and MSYS2 too.
This problem can be solved by adding the following configuration to .bashrc.
export MSYS=winsymlinks:nativestrict
before configuration
ln - s
does not create a symbolic link, it is copied.
it can not be deleted with rm - f, becouse it not sybolic link.
https://github.com/sdkman/sdkman-cli/blob/master/src/main/bash/sdkman-path-helpers.sh#L85
# sdk default java 8.0.202.hs-adpt
SDKMAN: No update needed. Using existing candidates cache: ant,asciidoctorj,bpipe,ceylon,crash,cuba,cxf,gaiden,glide,gradle,grails,groovy,groovyserv,infrastructor,java,jbake,kotlin,kscript,lazybones,leiningen,maven,micronaut,sbt,scala,spark,springboot,sshoogr,vertx,visualvm
Not refreshing version cache now...
Validate java 8.0.202.hs-adpt for MINGW64_NT-10.0: valid
Validation URL: https://api.sdkman.io/2/candidates/validate/java/8.0.202.hs-adpt/mingw64_nt-10.0
rm: cannot remove '/c/Users/tenten0213/.sdkman/candidates/java/current': Is a directory
ln: failed to create symbolic link '/c/Users/tenten0213/.sdkman/candidates/java/current/8.0.202.hs-adpt': File exists
after configuration
it works.
# sdk default java 8.0.202.hs-adpt
SDKMAN: No update needed. Using existing candidates cache: ant,asciidoctorj,bpipe,ceylon,crash,cuba,cxf,gaiden,glide,gradle,grails,groovy,groovyserv,infrastructor,java,jbake,kotlin,kscript,lazybones,leiningen,maven,micronaut,sbt,scala,spark,springboot,sshoogr,vertx,visualvm
Not refreshing version cache now...
Validate java 8.0.202.hs-adpt for MINGW64_NT-10.0: valid
Validation URL: https://api.sdkman.io/2/candidates/validate/java/8.0.202.hs-adpt/mingw64_nt-10.0
rm: cannot remove '/c/Users/tenten0213/.sdkman/candidates/java/current': Is a directory
ln: failed to create symbolic link '/c/Users/tenten0213/.sdkman/candidates/java/current/8.0.202.hs-adpt': File exists
Default java version set to 8.0.202.hs-adpt
@tenten0213 I recommend this option:
MSYS=winsymlinks:lnk
@tenten0213 @abcfy2 Is it worth writing this up in the FAQ?
Also, the output that you posted still had several errors. Shall we discuss this on the gitter cli-dev channel?