halcyon / asdf-java

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

No compatible versions available (java ) #190

Open lgf-136 opened 2 years ago

lgf-136 commented 2 years ago

⬢ [Systemd] ~/icu/source > asdf plugin-add java https://github.com/halcyon/asdf-java.git

⬢ [Systemd] ~/icu/source > asdf list-all java No compatible versions available (java )

vraravam commented 1 year ago

I tried the command from here and got a more verbose error:

Plugin java's list-all callback script failed with output:

Unknown machine architecture: arm64

I am running macos ventura on macos on an m1 machine. Please help!

vraravam commented 1 year ago

I tried the command from here and got a more verbose error:

Plugin java's list-all callback script failed with output:

Unknown machine architecture: arm64

I am running macos ventura on macos on an m1 machine. Please help!

UPDATE: I just upgraded to a specific SHA of this plugin, asdf plugin-update java 3d48135 - and i am now able to install java on the m1 macos machine. Will also try a fresh install to verify that the problem is now completely fixed.

UPDATE2: The same does NOT work on my intel mac!

vraravam commented 1 year ago

this is now broken on the m1 mac after the latest update to ad1f760f556b2e6538bbba62d92c8dae2e8430aa Also verified on the x64 intel machine - and its broken there as well. Is there any way we can help to ensure such broken versions don't leak and affect the users?

macdao commented 8 months ago

@lgf-136 I suspect the issue arises because your computer is unable to access https://raw.githubusercontent.com, as referenced in #https://github.com/halcyon/asdf-java/issues/173#issuecomment-1040255387. I've encountered this problem myself.

My workaround involves running the command cp ~/.asdf/plugins/java/data/jdk-macosx-x86_64-ga.tsv $TMPDIR/asdf-java-$(whoami).cache/releases-macosx-x86_64.tsv (for Intel computers) or cp ~/.asdf/plugins/java/data/jdk-macosx-aarch64-ga.tsv $TMPDIR/asdf-java-$(whoami).cache/releases-macosx-aarch64.tsv (for Apple silicon computers) before executing any other commands.

To better address this issue, I wonder if it's possible to directly fetch the release data from a local directory (eg. ~/.asdf/plugins/java/data/) instead of https://raw.githubusercontent.com. Users could update the release data by updating the plugin (asdf plugin update --all or asdf plugin update java).

I hope this suggestion can contribute to improving the plugin experience.