halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
470 stars 87 forks source link

Cannot install OpenJDK #21

Closed kossmoboleat closed 5 years ago

kossmoboleat commented 5 years ago

When I'm trying to install the OpenJDK version 13+33 the installation fails with many errors and leaves some intermediate installation files in my home directory.

I'm trying this on macOs 10.14.6. My default shell is zsh but I suspect it might be a problem I'm using bash 5 via homebrew as the default bash shell.

~ » asdf plugin-add java
~ » asdf install java adopt-openjdk-13+33
mktemp: too few X's in template ‘asdf-java’
stat: cannot read file system information for '%c': No such file or directory
/Users/tim/.asdf/plugins/java/bin/install: line 55: [[: File:: syntax error in expression (error token is ":")
######################################################################## 100.0%
OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz
######################################################################## 100.0%
OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz.sha256.txt
OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz: OK
mv: cannot stat 'Contents/Home/*': No such file or directory

And the intermediate files:

~ » ls ~/*jdk*
/Users/tim/OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz
/Users/tim/OpenJDK13U-jdk_x64_mac_hotspot_13_33.tar.gz.sha256.txt

/Users/tim/jdk-13+33:
Contents
halcyon commented 5 years ago

@kossmoboleat The problem, is that your system is running the gnu version of mktemp as opposed to the MacOS version. I would look for possible symlink, alias, or path causes of this.

% gmktemp -dt asdf-java                                                                                                                     
gmktemp: too few X's in template ‘asdf-java’

% which gmktemp                                                                                                                             /usr/local/bin/gmktemp

% gmktemp --version                                                                                                                         
mktemp (GNU coreutils) 8.31
...
% mktemp -dt asdf-java
/var/folders/h0/wf36d99d4f92nbmvtrtgvwxr0000gn/T/asdf-java.XYwkuOKy

% which mktemp
/usr/bin/mktemp
% sw_vers                                                                                                                                   
ProductName:    Mac OS X
ProductVersion: 10.14.6
BuildVersion:   18G103
kossmoboleat commented 5 years ago

awesome, that works. I did install some gnu utilities via homebrew and overwrite the default macOs ones, because I've been bitten by incompatibilities before. But given the time needed to debug this I've reversed the PATH settings for coreutils.