halcyon / asdf-java

A Java plugin for asdf-vm.
MIT License
455 stars 86 forks source link

Strange output when installing a new version of java on MacOS #107

Closed alexconlin closed 3 years ago

alexconlin commented 4 years ago

I just upgraded to the latest version of asdf-java and got this output when installing a new version of java

$ asdf install java adoptopenjdk-11.0.8+10
stat: cannot read file system information for '%c': No such file or directory
/Users/aconlin-oakley/.asdf/plugins/java/bin/install: line 49: ((: File: "/var/folders/lp/kqyc_xl960n9983b4r83d_tr0000gn/T//asdf-java.cache/releases.tsv"
    ID: 100000700000019 Namelen: ?       Type: apfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 122061322  Free: 7463614    Available: 2726592
Inodes: Total: 4882452880 Free: 4876245770 <= 1597269841 - 3600 : syntax error in expression (error token is ": "/var/folders/lp/kqyc_xl960n9983b4r83d_tr0000gn/T//asdf-java.cache/releases.tsv"
    ID: 100000700000019 Namelen: ?       Type: apfs
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 122061322  Free: 7463614    Available: 2726592
Inodes: Total: 4882452880 Free: 4876245770 <= 1597269841 - 3600 ")
#=#=-  #       #                                                                                                                                                                                                                                               #=O=#     #
  #                                                                                                                                                                                                                                           -#O=- #      #          #
######################################################################################################################################################################################################################################################### 100.0%-=O#-   #
 #           #                                                                                                                                                                                                                                  -=O=#      #         #
######################################################################################################################################################################################################################################################### 100.0%
OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz
OpenJDK11U-jdk_x64_mac_hotspot_11.0.8_10.tar.gz: OK
joschi commented 4 years ago

@alexconlin What's the output of which stat on your system?

alexconlin commented 4 years ago

A ha 😃

$ which stat
/usr/local/opt/coreutils/libexec/gnubin/stat

I have coreutils first on my path

joschi commented 4 years ago

@alexconlin asdfj-java is currently expecting BSD stat to be available on macOS: https://github.com/halcyon/asdf-java/blob/e6d6be3270b3984cf418329e2a3b00b37f8414b3/bin/functions#L11-L16

Maybe we could handle GNU coreutils being on the class path. That would be a feature request. 😉

halcyon commented 3 years ago

After looking carefully on my mac, I'd like to understand more. Why is /usr/local/opt/coreutils/libexec/gnubin part of PATH? Is homebrew being used to install/manage coreutils?

joschi commented 3 years ago

Is homebrew being used to install/manage coreutils?

Yes, exactly and after the installation Homebrew emits the following message:

Commands also provided by macOS have been installed with the prefix "g".
If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
    PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"

https://github.com/Homebrew/homebrew-core/blob/ddd4f0b1a030b98e065874e137e3d2fd604b3f41/Formula/coreutils.rb#L79-L82 https://formulae.brew.sh/formula/coreutils