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

Bug: Cannot install java on WSL2 system. #1256

Open
ruimo opened this issue Nov 24, 2023 · 4 comments
Open

Bug: Cannot install java on WSL2 system. #1256

ruimo opened this issue Nov 24, 2023 · 4 comments
Labels

Comments

@ruimo
Copy link

ruimo commented Nov 24, 2023

Bug report

When I try to install java, sdkman reports archive is corrupted error.

$ sdk install java 17.0.9-ms
Validate java 17.0.9-ms for linuxx64: valid
Validation URL: https://api.sdkman.io/2/candidates/validate/java/17.0.9-ms/linuxx64

Downloading: java 17.0.9-ms

In progress...

*   Trying 45.55.42.78:443...
* Connected to api.sdkman.io (45.55.42.78) port 443 (#0)
...
0%* Connection #2 to host download.visualstudio.microsoft.com left intact

Downloaded binary to: /home/shanai/.sdkman/tmp/java-17.0.9-ms.bin (HTTP headers written to: /home/shanai/.sdkman/var/metadata/java-17.0.9-ms.headers)
Get post-installation hook: https://api.sdkman.io/2/hooks/post/java/17.0.9-ms/linuxx64
Copy remote post-installation hook: /home/shanai/.sdkman/tmp/hook_post_java_17.0.9-ms.sh
A Linux 64bit post-install hook was found for Java 17.0.9-ms.

Repackaging Java 17.0.9-ms...
zip I/O error: No such file or directory
zip error: File not found or no read permission (/home/shanai/.sdkman/tmp/java-17.0.9-ms.zip)

Done repackaging...
Cleaning up residual files...
Processed binary as: /home/shanai/.sdkman/tmp/java-17.0.9-ms.zip
Completed post-installation hook...

ESC[1;31mStop! The archive was corrupt and has been removed! Please try installing again.ESC[0m

$ ls -l ~/.sdkman/tmp
total 8
-rw-r--r-- 1 shanai shanai  919 Nov 24 09:44 hook_post_java_17.0.9-ms.sh
-rw-r--r-- 1 shanai shanai 1323 Nov 24 09:44 java-17.0.9-ms.headers.tmp

Any other java distributions than 17.0.9-ms fail too. Network connection is normal (can connect network with web browser). Re-tried several times during a week but no luck.

To reproduce

$ sdk install java 17.0.9-ms

System info

  • Windows11 WSL2 (Ubuntu 22.04 5.15.133.1-microsoft-standard-WSL2 Requires internet connection at all times #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux)
  • bash 5.1.16(1)-release
  • script: 5.18.2/native: 0.4.3
  • zip: Zip 3.0 (July 5th 2008), by Info-ZIP
  • tar: tar (GNU tar) 1.34
  • gzip: gzip 1.10
@ruimo ruimo added the bug label Nov 24, 2023
@helpermethod
Copy link
Member

helpermethod commented Nov 24, 2023

Hi @ruimo!

Have you defined any aliases for zip, curl, gzip or tar? You can use type <command> to check this e.g. type zip. It will tell you if the command is an alias or not.

Furthermore, does the file /home/shanai/.sdkman/tmp/java-17.0.9-ms.zip exist after the installation failed?

@ruimo
Copy link
Author

ruimo commented Nov 24, 2023

Hi, @helpermethod,

No aliases:

$ type zip
zip is hashed (/usr/bin/zip)
$ type curl
curl is hashed (/usr/bin/curl)
$ type gzip
gzip is hashed (/usr/bin/gzip)
$ type tar
tar is hashed (/usr/bin/tar)

No zip files in ~/.sdkman/tmp as shown in the first post.

@helpermethod
Copy link
Member

Hi @ruimo!

Could it be that you are you behind a proxy?

@ruimo
Copy link
Author

ruimo commented Nov 27, 2023

Hi @helpermethod !

No, I can download the jdk directly by curl without proxy settings.

$ curl -L -o jdk.tar.gz https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-x64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  182M  100  182M    0     0  54.2M      0  0:00:03  0:00:03 --:--:-- 63.6M
$ ls -lh jdk.tar.gz
-rw-r--r-- 1 shanai shanai 183M Nov 28 08:17 jdk.tar.gz
$ echo $HTTP_PROXY

$ echo $HTTPS_PROXY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants