Giter VIP home page Giter VIP logo

asdf-java's People

Contributors

actions-user avatar bric3 avatar carhartl avatar codinganarchy avatar croaky avatar delgurth avatar emanresusername avatar fcrespo82 avatar gitter-badger avatar halcyon avatar jbwinters avatar jinmiaoluo avatar jmmk avatar jonatan-ivanov avatar joschi avatar matsavage avatar mig4 avatar mpern avatar nedtwigg avatar nicksen avatar pierreneter avatar salvatoret avatar sgtpooki avatar skotchpine avatar stefanodevuono avatar timpur avatar trustin avatar unicolet avatar whaley avatar zuisong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

asdf-java's Issues

javaws missing for java8

I have installed the following JDK:

  asdf list java
  adopt-openjdk-8u252-b09

But am missing the javaws utility in mac. Is this expected? If so, what alternatives do I have?

Thanks

Problems on Windows

Expected Behavior:

asdf install java 'adopt-openjdk-11.0.5+10_openj9-0.17.0'

New Java installed.

Current Behavior

asdf install java 'adopt-openjdk-11.0.5+10_openj9-0.17.0' will move all non-hidden, non-locked files in ${HOME} if the tarfile fails to expand.

Possible Solutions

Escape all shell variable expansions.

Use the special parameter -- to avoid confusing filenames with command parameters.

Make script use 'set -e', to abort instead of moving/destroying data.

Detailed logs

(captured with set -x in script)

++ basename https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10_openj9-0.17.0/OpenJDK11U-jdk_x64_windows_openj9_11.0.5_10_openj9-0.17.0.zip
+ tar zxf OpenJDK11U-jdk_x64_windows_openj9_11.0.5_10_openj9-0.17.0.zip
gzip: stdin has more than one entry--rest ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now
+++ ls -d '*/'
ls: cannot access '*/': No such file or directory
++ set --
++ echo
+ dir=
+ cd
+ mkdir -p /c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0
+ case ${OS} in
+ mv '3D Objects' AppData 'Application Data' Contacts Cookies Desktop Documents Downloads Favorites IdeaProjects Links 'Local Settings' Music 'My Documents' NTUSER.DAT 'NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TM.blf' 'NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TMContainer00000000000000000001.regtrans-ms' 'NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TMContainer00000000000000000002.regtrans-ms' NetHood Nox_share OneDrive Pictures PrintHood PycharmProjects Recent 'Saved Games' Searches SendTo 'Start Menu' Start.exe Sti_Trace.log Templates Videos ansel file.exe.stackdump inittk.ini inst.ini nice.exe.stackdump ntuser.dat.LOG1 ntuser.dat.LOG2 ntuser.ini nuuid.ini sh.exe.stackdump useruid.ini /c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0
mv: cannot move 'AppData' to '/c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0/AppData': Permission denied
mv: cannot move 'NTUSER.DAT' to '/c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0/NTUSER.DAT': Device or resource busy
mv: cannot move 'NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TM.blf' to '/c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0/NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TM.blf': Device or resource busy
mv: cannot move 'NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TMContainer00000000000000000001.regtrans-ms' to '/c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0/NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TMContainer00000000000000000001.regtrans-ms': Device or resource busy
mv: cannot move 'NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TMContainer00000000000000000002.regtrans-ms' to '/c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0/NTUSER.DAT{8e1aa5aa-c2c4-11e9-af24-9b12f01b32be}.TMContainer00000000000000000002.regtrans-ms': Device or resource busy
mv: cannot move 'ntuser.dat.LOG1' to '/c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0/ntuser.dat.LOG1': Device or resource busy
mv: cannot move 'ntuser.dat.LOG2' to '/c/Users/emp.justine/.local/share/_asdf/installs/java/adopt-openjdk-11.0.5+10_openj9-0.17.0/ntuser.dat.LOG2': Device or resource busy
+ cd /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin
+ rm -rf /tmp/asdf-java.3wteNNs4

Context (Environment)

https://github.com/halcyon/asdf-java/blob/master/bin/functions#L113

dir is set to "", because $(set -- $(ls -d */) ; echo ${1}) failed

https://github.com/halcyon/asdf-java/blob/master/bin/functions#L114

cd ${dir} is the same as cd

https://github.com/halcyon/asdf-java/blob/master/bin/functions#L122

mv * ${ASDF_INSTALL_PATH} means merge everything in last path to single file.

Getting "no properly formatted SHA256 checksum lines found" while installing some SDKs

[x80486@uplink ~]$ asdf install java azul-zulu-8.0.212
################################################################################################################################################################### 100.0%
zulu8.38.0.13-ca-jdk8.0.212-linux_x64.tar.gz
################################################################################################################################################################### 100.0%
zulu8.38.0.13-ca-jdk8.0.212-linux_x64.tar.gz.sha256.txt
sha256sum: zulu8.38.0.13-ca-jdk8.0.212-linux_x64.tar.gz.sha256.txt: no properly formatted SHA256 checksum lines found
[x80486@uplink ~]$ asdf install java azul-zulu-11.0.3
################################################################################################################################################################### 100.0%
zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz
################################################################################################################################################################### 100.0%
zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz.sha256.txt
sha256sum: zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz.sha256.txt: no properly formatted SHA256 checksum lines found
[x80486@uplink ~]$ asdf install java amazon-corretto-8.212.04.2
################################################################################################################################################################### 100.0%
amazon-corretto-8.212.04.2-linux-x64.tar.gz
################################################################################################################################################################### 100.0%
amazon-corretto-8.212.04.2-linux-x64.tar.gz.sha256.txt
sha256sum: amazon-corretto-8.212.04.2-linux-x64.tar.gz.sha256.txt: no properly formatted SHA256 checksum lines found
[x80486@uplink ~]$ asdf install java amazon-corretto-11.0.3.7.1
################################################################################################################################################################### 100.0%
amazon-corretto-11.0.3.7.1-linux-x64.tar.gz
################################################################################################################################################################### 100.0%
amazon-corretto-11.0.3.7.1-linux-x64.tar.gz.sha256.txt
sha256sum: amazon-corretto-11.0.3.7.1-linux-x64.tar.gz.sha256.txt: no properly formatted SHA256 checksum lines found

The installs are successfully though 😎 ...but I think it's worth to fix those. Not sure if that's only happening to me, because someone would have reported it already by this time.

Error when PROMPT_COMMAND already ends with semicolon

When using direnv and set-java-home.bash, the PROMPT_COMMAND will be set to:

_direnv_hook;; prompt_command

This causes bash to cry, because it does not like ;; 😢

-bash: PROMPT_COMMAND: line 0: syntax error near unexpected token `;;'
-bash: PROMPT_COMMAND: line 0: `_direnv_hook;; prompt_command'        

I thought of checking whether PROMPT_COMMAND already ends with ; to avoid adding another ;, but I am not a bash expert. Maybe there is a better way to solve this issue.

I am currently using this as a workaround:

export PROMPT_COMMAND="${PROMPT_COMMAND:+${PROMPT_COMMAND} :}"

. ~/.asdf/plugins/java/set-java-home.sh

PROMPT_COMMAND will be set to _direnv_hook; :; prompt_command. See this comment at Stackoverflow to understand what : stands for.

No adopt-openjdk 13 in list all results

I have installed Java 13 before:

~ asdf list java
adopt-openjdk-13.0.1+9
adopt-openjdk-8u242-b08

It was worked before, but now I want to install the latest version (adopt-openjdk-13.0.2+8), which you can see on the official website https://adoptopenjdk.net/?variant=openjdk13&jvmVariant=hotspot, but this version is not available and all other adopt-openjdk-13 versions are not available in asdf list also:

~ asdf list all java
adopt-openjdk-10.0.2+13
adopt-openjdk-10.0.2+13.1
adopt-openjdk-11+28
adopt-openjdk-11.0.1+13
adopt-openjdk-11.0.2+7
adopt-openjdk-11.0.2+9
adopt-openjdk-11.0.3+7
adopt-openjdk-11.0.4+11
adopt-openjdk-11.0.4+11.2
adopt-openjdk-11.0.4+11.4
adopt-openjdk-11.0.5+10
adopt-openjdk-11.0.6+10
adopt-openjdk-12+33
adopt-openjdk-12.0.1+12
adopt-openjdk-12.0.2+10
adopt-openjdk-12.0.2+10.2
adopt-openjdk-12.0.2+10.3
adopt-openjdk-8u172-b11
adopt-openjdk-8u181-b13
adopt-openjdk-8u191-b12
adopt-openjdk-8u192-b12
adopt-openjdk-8u202-b08
adopt-openjdk-8u212-b03
adopt-openjdk-8u212-b04
adopt-openjdk-8u222-b10
adopt-openjdk-8u232-b09
adopt-openjdk-8u242-b08
adopt-openjdk-9+181
adopt-openjdk-9.0.4+11
amazon-corretto-11.0.3.7.1
amazon-corretto-11.0.4.11.1
amazon-corretto-11.0.5.10.1
amazon-corretto-11.0.5.10.2
amazon-corretto-11.0.6.10.1
amazon-corretto-8.212.04.2
amazon-corretto-8.232.09.1
amazon-corretto-8.232.09.2
amazon-corretto-8.242.07.1
azul-zulu-11.31.11-jdk11.0.3
azul-zulu-11.35.13-jdk11.0.5
azul-zulu-11.35.15-jdk11.0.5
azul-zulu-11.37.17-jdk11.0.6
azul-zulu-12.2.3-jdk12.0.1
azul-zulu-13.27.9-jdk13
azul-zulu-13.28.11-jdk13.0.1
azul-zulu-13.29.9-jdk13.0.2
azul-zulu-7.29.0.5-jdk7.0.222
azul-zulu-7.34.0.5-jdk7.0.242
azul-zulu-7.36.0.5-jdk7.0.252
azul-zulu-8.42.0.21-jdk8.0.232
azul-zulu-8.42.0.23-jdk8.0.232
azul-zulu-8.44.0.9-jdk8.0.242
azul-zulufx-11.35.15-jdk11.0.5
azul-zulufx-8.42.0.23-jdk8.0.232
adopt-openjdk-10.0.2+13_openj9-0.9.0
adopt-openjdk-11.0.2+9_openj9-0.12.1
adopt-openjdk-11.0.3+7_openj9-0.14.0
adopt-openjdk-11.0.3+7_openj9-0.14.3
adopt-openjdk-11.0.4+11.2_openj9-0.15.1
adopt-openjdk-11.0.4+11.4_openj9-0.15.1
adopt-openjdk-11.0.4+11_openj9-0.15.1
adopt-openjdk-11.0.5+10.1_openj9-0.17.0
adopt-openjdk-11.0.5+10_openj9-0.17.0
adopt-openjdk-11.0.6+10_openj9-0.18.0
adopt-openjdk-11.0.6+10_openj9-0.18.1
adopt-openjdk-12+33_openj9-0.13.0
adopt-openjdk-12.0.1+12_openj9-0.14.1
adopt-openjdk-12.0.2+10.2_openj9-0.15.1
adopt-openjdk-12.0.2+10.3_openj9-0.15.1
adopt-openjdk-12.0.2+10_openj9-0.15.1
adopt-openjdk-8u162-b12_openj9-0.8.0
adopt-openjdk-8u181-b13_openj9-0.9.0
adopt-openjdk-8u192-b12_openj9-0.11.0
adopt-openjdk-8u202-b08_openj9-0.12.1
adopt-openjdk-8u212-b03_openj9-0.14.0
adopt-openjdk-8u212-b04_openj9-0.14.2
adopt-openjdk-8u222-b10_openj9-0.15.1
adopt-openjdk-8u232-b09.1_openj9-0.17.0
adopt-openjdk-8u232-b09_openj9-0.17.0
adopt-openjdk-8u242-b08_openj9-0.18.1
adopt-openjdk-9.0.4+12_openj9-0.9.0
adopt-openjdk-11.0.2+9_openj9-0.12.1_large-heap
adopt-openjdk-11.0.3+7_openj9-0.14.0_large-heap
adopt-openjdk-11.0.3+7_openj9-0.14.3_large-heap
adopt-openjdk-11.0.4+11.2_openj9-0.15.1_large-heap
adopt-openjdk-11.0.4+11.4_openj9-0.15.1_large-heap
adopt-openjdk-11.0.4+11_openj9-0.15.1_large-heap
adopt-openjdk-11.0.5+10.1_openj9-0.17.0_large-heap
adopt-openjdk-11.0.5+10_openj9-0.17.0_large-heap
adopt-openjdk-11.0.6+10_openj9-0.18.0_large-heap
adopt-openjdk-11.0.6+10_openj9-0.18.1_large-heap
adopt-openjdk-12+33_openj9-0.13.0_large-heap
adopt-openjdk-12.0.1+12_openj9-0.14.1_large-heap
adopt-openjdk-12.0.2+10.2_openj9-0.15.1_large-heap
adopt-openjdk-12.0.2+10_openj9-0.15.1_large-heap
adopt-openjdk-8u181-b13_openj9-0.9.0_large-heap
adopt-openjdk-8u192-b12_openj9-0.11.0_large-heap
adopt-openjdk-8u202-b08_openj9-0.12.1_large-heap
adopt-openjdk-8u212-b03_openj9-0.14.0_large-heap
adopt-openjdk-8u212-b04_openj9-0.14.2_large-heap
adopt-openjdk-8u222-b10_openj9-0.15.1_large-heap
adopt-openjdk-8u232-b09.1_openj9-0.17.0_large-heap
adopt-openjdk-8u232-b09_openj9-0.17.0_large-heap
adopt-openjdk-8u242-b08_openj9-0.18.1_large-heap

Even if I try to install it directly I'm getting this error:

~ asdf install java adopt-openjdk-13.0.2+8
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

JAVA_HOME did not get updated

If I switch between java versions, JAVA_HOME did not get updated.

❯ asdf current
java           adopt-openjdk-13.0.2+8 (set by /Users/jivanov/.tool-versions)

❯ java -version
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.2+8)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.2+8, mixed mode, sharing)

❯ echo $JAVA_HOME
/Users/jivanov/.asdf/installs/java/adopt-openjdk-13.0.2+8

❯ asdf global java adopt-openjdk-8u242-b08

❯ asdf current
java           adopt-openjdk-8u242-b08 (set by /Users/jivanov/.tool-versions)

❯ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)

❯ echo $JAVA_HOME
/Users/jivanov/.asdf/installs/java/adopt-openjdk-13.0.2+8

Missing AdoptOpenJDK releases where there are >20 for a majorVersion/arch/os combination

It seems the V3 API has a hidden/undocumented max page_size of 20. Despite this plugin setting the page size to 100 this means release lists are getting cropped; as the plugin doesn't have the ability to iterate through pages of feature_releases API calls.

Current this means that the mac x64 adoptopen jdk releases of 11.0.7+10 are unable to be located.

I've asked about this here, but if the behaviour is intentional we may need to find a way to either

  • support paging of releases
  • sort DESC so we always get the most recent 20 releases rather than the oldest (?)

MacOS support for /usr/libexec/java_home

MacOS has a convention of using /usr/libexec/java_home to list installed JVMs/JDKs. Instead of overwriting JAVA_HOME, can we make use of /usr/libexec/java_home instead? Perhaps a symlink can be added in here: /Library/Java/JavaVirtualMachines/.

Failed to list-all java

Hi, I failed to run command asdf list-all java and asdf install java xxx

the error msg is :

asdf list-all java
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 41852, column 5
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 41852, column 5
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 41852, column 5

Add support for fish

asdf supports fish built-in, though asdf-java only have sources for bash and zsh.

Much appreciated

A way to install a JDK from a directory

This is a bit tougher, but with jenv, I could install a JDK, and do something like jenv add /path/to/jdk and it would determine the major, minor and patch versions from the output of java -version in that directory.

It was really handy to be able to add a JDK, especially the ones from oracle. I'm not sure how this would work, but it'd be useful. Found myself missing this functionality yesterday.

Wrong path to bin directory

This script looks at this path. and it's wrong.

~/.asdf/installs/java/amazon-corretto-11.0.3.7.1/bin/java

It should be:

~/.asdf/installs/java/amazon-corretto-11.0.3.7.1/Contents/Home/bin/java

Remove Travis CI builds or provide GitHub API token

The build jobs on Travis CI for macOS are currently failing because the workers have exhausted the GitHub API rate-limit.

Example: https://travis-ci.org/halcyon/asdf-java/jobs/656934756#L246-L279

The GitHub Actions workflow doesn't have this problem because they can use an automatically generated GitHub API token: https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token

In order to allow for a successful build status for commits and PRs, either remove the Travis CI builds completely in favor of the existing GitHub Actions workflow or provide a valid GitHub API token for builds.

Cannot install OpenJDK

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

OpenJDK 8 versions?

Unfortunately, from time to time, Java 8 is still needed and I was wondering if would be possible to provide OpenJDK 8 builds?

list-all dont work

listing....

List all java versions:
/home/art/.asdf/plugins/java/bin/list-all: string 71: jq: command not found
/home/art/.asdf/plugins/java/bin/list-all: string 59: jq: command not found
/home/art/.asdf/plugins/java/bin/list-all: string 71: jq: command not found
/home/art/.asdf/plugins/java/bin/list-all: string 59: jq: command not found
/home/art/.asdf/plugins/java/bin/list-all: string 71: jq: command not found
/home/art/.asdf/plugins/java/bin/list-all: string 59: jq: command not found

Update check sum for amazon-corretto-8.252.09.1 on Mac

Install got this error:

$ asdf install java amazon-corretto-8.252.09.1
######################################################################################################################################################################################################### 100.0%
amazon-corretto-8.252.09.1-macosx-x64.tar.gz
gsha256sum: 'standard input': no properly formatted SHA256 checksum lines found

then need to update https://github.com/halcyon/asdf-java/blob/master/corretto/corretto.json file checksum from:

{
    "release_name": "amazon-corretto-8.252.09.1",
    "binaries": [
      ......
      {
        "os": "mac",
        "architecture": "x64",
        "jvm_impl": "hotspot",
        "package": {
          "link": "https://corretto.aws/downloads/resources/8.252.09.1/amazon-corretto-8.252.09.1-macosx-x64.tar.gz",
          "checksum": "f0204183832f590689055fcd98366ebb43196c84442a9bcb768ac230"
        },
        "heap_size": "normal"
      }
    ]
  },

to:

{
    "release_name": "amazon-corretto-8.252.09.1",
    "binaries": [
      ......
      {
        "os": "mac",
        "architecture": "x64",
        "jvm_impl": "hotspot",
        "package": {
          "link": "https://corretto.aws/downloads/resources/8.252.09.1/amazon-corretto-8.252.09.1-macosx-x64.tar.gz",
          "checksum": "91988dbfac788eda6b1fbc6a885eb45f0f7873c8b478276b6a5c9fda3141448c"
        },
        "heap_size": "normal"
      }
    ]
  }, 

Support /usr/libexec/java_home for installs

I just had a hard time to figure that out:
When I try to run anything Eclipse-based (in this case, Apache Directory Studio) and I do not have a "proper" Java installation (one that does not end up in /Library/Java/JavaFrameworks and has all the Info.plist and other foo), MacOS presents me with an error message. This error message only tells me to install legacy Java.

So, it would be great if installing a version via this plugin would create the symlinks or meta-information needed so that java_home "just" picks up the available versions. The benefit would be that applications like ADS or Eclipse would run out of the box.

Spoilers: Following up search results on how to fix this manually point to the Eclipse Info.plist. Unfortunately, configuring the -vm flag doesn't help.

A way to specify `asdf shell java 11`

For simplicity, it'd be nice to have that behavior similar to how jenv shell 11 would work. Just use the java 11 that you have available. If you've got more than one, it should probably fail.

It'd sure be nice to be able to use a .java-version with just 11 in it. As best as I can tell that won't work?

I've got java stuff that just needs to run on some java 1.8. And other things that just need some java 11. So it'd be nice if it could pick a tool that is compatible with java 1.8 or java 11, without having to be explicit about the precise versions of JVM installed.

~ > cd ~/apacheds/ApacheDirectoryStudio/
apacheds/ApacheDirectoryStudio > java -version
asdf: No preset version installed for command java
Please install the missing version by running one of the following:

asdf install java 1.8

or add one of the following in your .tool-versions file:

java adopt-openjdk-11.0.7+10
java adopt-openjdk-8u252-b09
apacheds/ApacheDirectoryStudio > cat .java-version
1.8

Error messages on macOS 10.15.1 with Bash 5.0.11(1)-release

When running asdf list-all java on macOS 10.15.1 with Bash 5.0.11(1)-release, I receive some error messages, although the actual listing of available Java versions seems to work.

  • asdf v0.7.5
  • bash 5.0.11(1)-release
  • macOS Catalina 10.15.1 (19B88)
# asdf --version
v0.7.5

# asdf plugin-list --urls
gradle          https://github.com/rfrancis/asdf-gradle.git
java            https://github.com/halcyon/asdf-java.git
maven           https://github.com/halcyon/asdf-maven.git

# echo $BASH_VERSION
5.0.11(1)-release

# LC_ALL=C asdf list-all java
mktemp: too few X's in template 'asdf-java'
stat: cannot read file system information for '%c': No such file or directory
/Users/joschi/.asdf/plugins/java/bin/list-all: line 55: [[: File:: syntax error in expression (error token is ":")
adopt-openjdk-10.0.2+13
[...]

Add support for "latest" versions

With asdf 0.7.6 it is possible to use the latest keyword to install a tool and there is a new latest command to display the latest version available

https://asdf-vm.com/#/changelog?id=_076

Because the version is also used for the distribution using only the latest keyword could be strange but it could be useful with at least a distribution name and version prefix

  asdf install java latest # Not sure what it could do here...
  asdf install java latest:adopt-openjdk # installs latest Java version from adopt-openjdk
  asdf install java latest:adopt-openjdk-11 # installs latest Java 11.x version from adopt-openjdk
  asdf latest java # Not sure what it could do here...
  asdf latest java adopt-openjdk # displays latest Java version from adopt-openjdk
  asdf latest java adopt-openjdk-11 # displays latest Java 11.x version from adopt-openjdk

Unable to run `asdf list-all java` under MSYS2

Expected:

$ asdf list-all graalvm
1.0.0-rc1
1.0.0-rc10
1.0.0-rc11
1.0.0-rc12
1.0.0-rc13
1.0.0-rc14
1.0.0-rc15
1.0.0-rc16
1.0.0-rc2
1.0.0-rc3
1.0.0-rc4
1.0.0-rc5
1.0.0-rc6
1.0.0-rc7
1.0.0-rc8
1.0.0-rc9
19.0.0
19.0.2
19.1.0
19.1.1
19.2.0
19.2.0-dev-b01
19.2.0.1
19.2.1

I got instead:

$ asdf list-all java
/c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/list-all: line 1: functions: command not found

Is plugins/${_PLUGIN_NAME}/bin/ expected to be in $PATH?

My environment:

$ head /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/*
==> /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/functions <==
#!/usr/bin/env bash

PLUGIN_HOME=$(dirname $(dirname "${0}"))
CACHE_DIR="/tmp/asdf-java.cache"
mkdir -p ${CACHE_DIR}

case $(uname -s) in
    Darwin) OS="mac"
            SHA256SUM="gsha256sum"
            STAT="stat -f %c ${CACHE_DIR}/*"

==> /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/install <==
functions
==> /c/Users/emp.justine/.local/share/_asdf/plugins/java/bin/list-all <==
functions

$ set | grep -E 'OSTYPE|ASDF'
ASDF_BIN=/c/Users/emp.justine/.local/share/_asdf/bin
ASDF_CONFIG_FILE=/c/Users/emp.justine/.config/_asdfrc
ASDF_DATA_DIR=/c/Users/emp.justine/.local/share/_asdf
ASDF_DIR=/c/Users/emp.justine/.local/share/_asdf
ASDF_USER_SHIMS=/c/Users/emp.justine/.local/share/_asdf/shims
OSTYPE=msys

$ asdf current
graalvm        No version set for graalvm; please run `asdf <global | local> graalvm <version>`
java           No version set for java; please run `asdf <global | local> java <version>`

Make openJDK's JVM variants distinguishable when using asdf's `latest[:<version>]` syntax.

With how the versions are currently named, there seems to be no way to distinguish between openJDK's openJ9 and HotSpot JVM variants.

Listing all available versions...

asdf list all java adopt-openjdk-13

Yields

adopt-openjdk-13+33
adopt-openjdk-13.0.1+9
adopt-openjdk-13.0.2+8
adopt-openjdk-13+33_openj9-0.16.0
adopt-openjdk-13.0.1+9.1_openj9-0.17.0
adopt-openjdk-13.0.1+9_openj9-0.17.0
adopt-openjdk-13.0.2+8_openj9-0.18.0
adopt-openjdk-13+33_openj9-0.16.0_large-heap
adopt-openjdk-13.0.1+9.1_openj9-0.17.0_large-heap
adopt-openjdk-13.0.1+9_openj9-0.17.0_large-heap
adopt-openjdk-13.0.2+8_openj9-0.18.0_large-heap  

however...

asdf latest java adopt-openjdk-13

yields

adopt-openjdk-13.0.2+8_openj9-0.18.0_large-heap

So, if you were to run asdf install java latest:adopt-openjdk-13 you will install the version above.

Since the version number will increment with every release, and the JVM variant and large_heap option is on the right side of the version number, you cannot currently use asdf's latest[:<version>] syntax if you do not want the openj9 JVM variant with the large_heap option.

It would be nice to change the version naming scheme so the JVM variant and large_heap options appears on the left side of the version number, making different versions of the same release distinguishable, and asdf's latest[:<version>] syntax useable.

For example...

adopt-openjdk-13.0.2+8
adopt-openjdk-openj9-13.0.2+8-0.18.0
adopt-openjdk-openj9-large_heap-13.0.2+8-0.18.0

no URL specified

$ asdf install java adopt-openjdk-8u222-b10
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

I'm running this on a Raspberry Pi 4B+.

set-java-home for fish and bash not setting JAVA_HOME

Running with bash . ~/.asdf/plugins/java/set-java-home.bash (version 5.0.17)

bash: PROMPT_COMMAND: line 16: syntax error near unexpected token `;'
bash: PROMPT_COMMAND: line 16: `; prompt_command; prompt_command'

Running . ~/.asdf/plugins/java/set-java-home.fish (version 3.1.0)
Doesn't cause any errors but $JAVA_HOME does not seem to be set.

OpenJDK not available for version higher than 9

I already installed 2 different versions of java on my laptop with asdf in the past:

[18:07:18] lhauspie@997H8H2:~/projects/perso(master)$ asdf global java adopt-openjdk-1<tab><tab>
adopt-openjdk-12.0.2+10  adopt-openjdk-13.0.2+8   

But when I ask asdf to install a new version of Java, I don't find any version of OpenJDK higher than jdk9:

[18:27:19] lhauspie@997H8H2:~/.asdf/plugins/java(master)$ asdf install java <tab><tab>
amazon-corretto-11.0.3.7.1               azul-zulu-11.31.11-jdk11.0.3             azul-zulu-8.42.0.21-jdk8.0.232           jdk8u192-b12_openj9-0.11.0               jdk8u232-b09.1_openj9-0.17.0_large-heap
amazon-corretto-11.0.4.11.1              azul-zulu-11.35.13-jdk11.0.5             azul-zulu-8.42.0.23-jdk8.0.232           jdk8u192-b12_openj9-0.11.0_large-heap    jdk8u232-b09_openj9-0.17.0
amazon-corretto-11.0.5.10.1              azul-zulu-11.35.15-jdk11.0.5             azul-zulu-8.44.0.11-jdk8.0.242           jdk8u202-b08_openj9-0.12.1               jdk8u232-b09_openj9-0.17.0_large-heap
amazon-corretto-11.0.5.10.2              azul-zulu-11.37.17-jdk11.0.6             azul-zulu-8.44.0.9-jdk8.0.242            jdk8u202-b08_openj9-0.12.1_large-heap    jdk8u242-b08_openj9-0.18.1
amazon-corretto-11.0.6.10.1              azul-zulu-12.2.3-jdk12.0.1               azul-zulufx-11.35.15-jdk11.0.5           jdk8u212-b03_openj9-0.14.0               jdk8u242-b08_openj9-0.18.1_large-heap
amazon-corretto-11.0.6.10.1-2            azul-zulu-13.27.9-jdk13                  azul-zulufx-11.37.19-jdk11.0.6           jdk8u212-b03_openj9-0.14.0_large-heap    jdk-9.0.4+12_openj9-0.9.0
amazon-corretto-8.212.04.2               azul-zulu-13.28.11-jdk13.0.1             azul-zulufx-8.42.0.23-jdk8.0.232         jdk8u212-b04_openj9-0.14.2               sapmachine-11.0.6
amazon-corretto-8.232.09.1               azul-zulu-13.29.9-jdk13.0.2              azul-zulufx-8.44.0.13-jdk8.0.242         jdk8u212-b04_openj9-0.14.2_large-heap    sapmachine-11.0.6.0.1
amazon-corretto-8.232.09.2               azul-zulu-7.29.0.5-jdk7.0.222            jdk8u162-b12_openj9-0.8.0                jdk8u222-b10_openj9-0.15.1               sapmachine-13.0.2
amazon-corretto-8.242.07.1               azul-zulu-7.34.0.5-jdk7.0.242            jdk8u181-b13_openj9-0.9.0                jdk8u222-b10_openj9-0.15.1_large-heap    sapmachine-14
amazon-corretto-8.242.08.1               azul-zulu-7.36.0.5-jdk7.0.252            jdk8u181-b13_openj9-0.9.0_large-heap     jdk8u232-b09.1_openj9-0.17.0             

And when I still trying to install a version not listed here, I have an error:

[18:32:24] lhauspie@997H8H2:~/.asdf/plugins/java(master)$ asdf install java adopt-openjdk-13.0.2+8
curl: Remote file name has no length!
curl: try 'curl --help' or 'curl --manual' for more information

I also tried to install a OpenJDK version listed above, but nothing works:

[18:49:33] lhauspie@997H8H2:~/projects/perso/cqrs-exploration/cqrs-microservice-sampler(master)$ asdf install java jdk8u242-b08_openj9-0.18.1
curl: Remote file name has no length!
curl: try 'curl --help' or 'curl --manual' for more information

And the plugin have been correctly updated:

[18:42:41] lhauspie@997H8H2:~/.asdf/plugins/java(master)$ asdf plugin update java
Updating java...
Déjà sur 'master'
Votre branche est à jour avec 'origin/master'.
[18:42:42] lhauspie@997H8H2:~/.asdf/plugins/java(master)$ git log --oneline
e5391ad (HEAD -> master, origin/master, origin/HEAD) JDK 14

As I'm on linux (Ubuntu) with an x64 architecture, I tried to list the OpenJDK versions 10, 11, 12 and 13 by reaching these v3 API urls, and they all returned at least one result, so what's going wrong ?

https://api.adoptopenjdk.net/v3/assets/feature_releases/10/ga?architecture=x64&os=linux&image_type=jdk&page=0&page_size=100&project=jdk&sort_order=ASC&vendor=adoptopenjdk
https://api.adoptopenjdk.net/v3/assets/feature_releases/11/ga?architecture=x64&os=linux&image_type=jdk&page=0&page_size=100&project=jdk&sort_order=ASC&vendor=adoptopenjdk
https://api.adoptopenjdk.net/v3/assets/feature_releases/12/ga?architecture=x64&os=linux&image_type=jdk&page=0&page_size=100&project=jdk&sort_order=ASC&vendor=adoptopenjdk
https://api.adoptopenjdk.net/v3/assets/feature_releases/13/ga?architecture=x64&os=linux&image_type=jdk&page=0&page_size=100&project=jdk&sort_order=ASC&vendor=adoptopenjdk

Thanks in advance.

Segfault in jq when list-all java

I've tried fixes in #18, #14, and #21.

asdf list-all java
/Users/skim/.asdf/plugins/java/bin/list-all: line 61: 14714 Segmentation fault: 11 jq '(.[].release_name) |= sub("jdk-";"adopt-openjdk-") | (.[].release_name) |= sub("^jdk";"adopt-openjdk-")' ${CACHE_DIR}/${i} > ${CACHE_DIR}/${i}.temp
/Users/skim/.asdf/plugins/java/bin/list-all: line 61: 14716 Segmentation fault: 11 jq '(.[].release_name) |= sub("jdk-";"adopt-openjdk-") | (.[].release_name) |= sub("^jdk";"adopt-openjdk-")' ${CACHE_DIR}/${i} > ${CACHE_DIR}/${i}.temp
/Users/skim/.asdf/plugins/java/bin/list-all: line 61: 14718 Segmentation fault: 11 jq '(.[].release_name) |= sub("jdk-";"adopt-openjdk-") | (.[].release_name) |= sub("^jdk";"adopt-openjdk-")' ${CACHE_DIR}/${i} > ${CACHE_DIR}/${i}.temp
/Users/skim/.asdf/plugins/java/bin/list-all: line 61: 14720 Segmentation fault: 11 jq '(.[].release_name) |= sub("jdk-";"adopt-openjdk-") | (.[].release_name) |= sub("^jdk";"adopt-openjdk-")' ${CACHE_DIR}/${i} > ${CACHE_DIR}/${i}.temp
/Users/skim/.asdf/plugins/java/bin/list-all: line 61: 14722 Segmentation fault: 11 jq '(.[].release_name) |= sub("jdk-";"adopt-openjdk-") | (.[].release_name) |= sub("^jdk";"adopt-openjdk-")' ${CACHE_DIR}/${i} > ${CACHE_DIR}/${i}.temp
/Users/skim/.asdf/plugins/java/bin/list-all: line 61: 14724 Segmentation fault: 11 jq '(.[].release_name) |= sub("jdk-";"adopt-openjdk-") | (.[].release_name) |= sub("^jdk";"adopt-openjdk-")' ${CACHE_DIR}/${i} > ${CACHE_DIR}/${i}.temp
amazon-corretto-11.0.3.7.1
amazon-corretto-8.212.04.2
azul-zulu-11.0.3
azul-zulu-12.0.1
azul-zulu-13.27.9
azul-zulu-7u222
azul-zulu-8.0.212

asdf list-all java errors out for sapmachine.json

There is something going on with SAP Machine builds (or something like that):

[x80486uplink:~]$ asdf list-all java 
jq: error: Could not open file /tmp/asdf-java.cache/sapmachine.json: No such file or directory
adopt-openjdk-10.0.2+13.1
adopt-openjdk-11+28
adopt-openjdk-11.0.1+13
adopt-openjdk-11.0.2+7
adopt-openjdk-11.0.2+9
adopt-openjdk-11.0.3+7
adopt-openjdk-11.0.4+11
adopt-openjdk-11.0.5+10
adopt-openjdk-11.0.6+10
adopt-openjdk-11.0.7+10
adopt-openjdk-12+33
adopt-openjdk-12.0.1+12
adopt-openjdk-12.0.2+10
adopt-openjdk-13+33
adopt-openjdk-13.0.1+9
adopt-openjdk-13.0.2+8
adopt-openjdk-14+36
adopt-openjdk-14.0.1+7
adopt-openjdk-8u181-b13
adopt-openjdk-8u192-b12
adopt-openjdk-8u202-b08
adopt-openjdk-8u212-b03
adopt-openjdk-8u212-b04
adopt-openjdk-8u222-b10
adopt-openjdk-8u232-b09
adopt-openjdk-8u242-b08
adopt-openjdk-8u252-b09
adopt-openjdk-9+181
adopt-openjdk-9.0.4+11
amazon-corretto-11.0.3.7.1
amazon-corretto-11.0.4.11.1
amazon-corretto-11.0.5.10.1
amazon-corretto-11.0.5.10.2
amazon-corretto-11.0.6.10.1
amazon-corretto-11.0.6.10.1-2
amazon-corretto-11.0.7.10.1
amazon-corretto-8.212.04.2
amazon-corretto-8.232.09.1
amazon-corretto-8.232.09.2
amazon-corretto-8.242.07.1
amazon-corretto-8.242.08.1
amazon-corretto-8.252.09.1
azul-zulu-11.31.11-jdk11.0.3
azul-zulu-11.35.13-jdk11.0.5
azul-zulu-11.35.15-jdk11.0.5
azul-zulu-11.37.17-jdk11.0.6
azul-zulu-11.39.15-jdk11.0.7
azul-zulu-12.2.3-jdk12.0.1
azul-zulu-13.27.9-jdk13
azul-zulu-13.28.11-jdk13.0.1
azul-zulu-13.29.9-jdk13.0.2
azul-zulu-14.27.1-jdk14
azul-zulu-7.29.0.5-jdk7.0.222
azul-zulu-7.34.0.5-jdk7.0.242
azul-zulu-7.36.0.5-jdk7.0.252
azul-zulu-8.42.0.21-jdk8.0.232
azul-zulu-8.42.0.23-jdk8.0.232
azul-zulu-8.44.0.11-jdk8.0.242
azul-zulu-8.44.0.9-jdk8.0.242
azul-zulu-8.46.0.19-jdk8.0.252
azul-zulufx-11.35.15-jdk11.0.5
azul-zulufx-11.37.19-jdk11.0.6
azul-zulufx-8.42.0.23-jdk8.0.232
azul-zulufx-8.44.0.13-jdk8.0.242
azul-zulufx-8.46.0.19-jdk8.0.252
adopt-openjdk-10.0.2+13_openj9-0.9.0
adopt-openjdk-11.0.2+9_openj9-0.12.1
adopt-openjdk-11.0.3+7_openj9-0.14.0
adopt-openjdk-11.0.3+7_openj9-0.14.3
adopt-openjdk-11.0.4+11_openj9-0.15.1
adopt-openjdk-11.0.5+10_openj9-0.17.0
adopt-openjdk-11.0.6+10_openj9-0.18.0
adopt-openjdk-11.0.6+10_openj9-0.18.1
adopt-openjdk-11.0.7+10_openj9-0.20.0
adopt-openjdk-12+33_openj9-0.13.0
adopt-openjdk-12.0.1+12_openj9-0.14.1
adopt-openjdk-12.0.2+10_openj9-0.15.1
adopt-openjdk-13+33_openj9-0.16.0
adopt-openjdk-13.0.1+9_openj9-0.17.0
adopt-openjdk-13.0.2+8_openj9-0.18.0
adopt-openjdk-14+36.1_openj9-0.19.0
adopt-openjdk-14+36_openj9-0.19.0
adopt-openjdk-14.0.1+7_openj9-0.20.0
adopt-openjdk-8u162-b12_openj9-0.8.0
adopt-openjdk-8u181-b13_openj9-0.9.0
adopt-openjdk-8u192-b12_openj9-0.11.0
adopt-openjdk-8u202-b08_openj9-0.12.1
adopt-openjdk-8u212-b03_openj9-0.14.0
adopt-openjdk-8u212-b04_openj9-0.14.2
adopt-openjdk-8u222-b10_openj9-0.15.1
adopt-openjdk-8u232-b09_openj9-0.17.0
adopt-openjdk-8u242-b08_openj9-0.18.1
adopt-openjdk-8u252-b09_openj9-0.20.0
adopt-openjdk-9.0.4+12_openj9-0.9.0
adopt-openjdk-11.0.2+9_openj9-0.12.1_large-heap
adopt-openjdk-11.0.3+7_openj9-0.14.0_large-heap
adopt-openjdk-11.0.3+7_openj9-0.14.3_large-heap
adopt-openjdk-11.0.4+11_openj9-0.15.1_large-heap
adopt-openjdk-11.0.5+10_openj9-0.17.0_large-heap
adopt-openjdk-11.0.6+10_openj9-0.18.0_large-heap
adopt-openjdk-11.0.6+10_openj9-0.18.1_large-heap
adopt-openjdk-11.0.7+10_openj9-0.20.0_large-heap
adopt-openjdk-12+33_openj9-0.13.0_large-heap
adopt-openjdk-12.0.1+12_openj9-0.14.1_large-heap
adopt-openjdk-12.0.2+10_openj9-0.15.1_large-heap
adopt-openjdk-13+33_openj9-0.16.0_large-heap
adopt-openjdk-13.0.1+9_openj9-0.17.0_large-heap
adopt-openjdk-13.0.2+8_openj9-0.18.0_large-heap
adopt-openjdk-14+36.1_openj9-0.19.0_large-heap
adopt-openjdk-14+36_openj9-0.19.0_large-heap
adopt-openjdk-14.0.1+7_openj9-0.20.0_large-heap
adopt-openjdk-8u192-b12_openj9-0.11.0_large-heap
adopt-openjdk-8u202-b08_openj9-0.12.1_large-heap
adopt-openjdk-8u212-b03_openj9-0.14.0_large-heap
adopt-openjdk-8u212-b04_openj9-0.14.2_large-heap
adopt-openjdk-8u222-b10_openj9-0.15.1_large-heap
adopt-openjdk-8u232-b09_openj9-0.17.0_large-heap
adopt-openjdk-8u242-b08_openj9-0.18.1_large-heap
adopt-openjdk-8u252-b09_openj9-0.20.0_large-heap

It happens even if I remove the /tmp/asdf-java.cache/ before executing that command. I'm using ASDF version v0.7.8-4a3e3d6 under Arch Linux with GNU bash, version 5.0.16(1)-release.

Also, isn't weird that the list is split for adopt-openjdk?

I cannot see openJDK versions after update

Hi! I updated my plug-in version and I just can see the versions:

amazon-corretto-11.0.3.7.1
amazon-corretto-8.212.04.2
azul-zulu-11.0.3
azul-zulu-12.0.1
azul-zulu-7u222
azul-zulu-8.0.212

(result of "list-all" command)

I installed all requirements here (jq, sha256sum and curl). I'm using Linux Mint 19.2.

Thanks :)

asdf java commands can delete a lot of stuff

I am not sure how I got firstly this error:

asdf list-all java
mkdir: /tmpasdf-java.cache: Read-only file system
/Users/arnaud/.asdf/plugins/java/bin/list-all: line 1: TEMP_DIR: unbound variable

Stupidly I created TEMP_DIR but messed up it and in a way that TEMP_DIR=$HOME

Calling it again ...

asdf list-all java
mkdir: /Users/arnaudasdf-java.cache: Permission denied
rm: /Users/arnaud/.config/htop: Permission denied
rm: /Users/arnaud/.config: Directory not empty
rm: /Users/arnaud/Music: Permission denied

The script started to delete my HOME !!!

There are 2 issues in your script from my POV:

trap 'rm -rf ${TEMP_DIR}' EXIT

trap shouldn't be called without ensuring first that you created TEMP_DIR. That's why I got

TEMP_DIR: unbound variable

Then I would advise to name the variable ASDF_JAVA_TEMP_DIR or something like that to be sure that you don't conflict with an end-user variable called TEMP_DIR

Thanks

Error "parse error: Invalid numeric literal" when running `asdf list-all java`

Hello. I'm trying to use this plugin to install different Java versions.

I'm using the following versions:

  • macOS 10.14.6
  • asdf 0.7.7
  • jq 1.6
  • curl 7.54.0

While following the instructions, I'm running into this issue:

$ asdf plugin list
elixir
erlang
nodejs
ruby
$ asdf plugin add java
$ asdf list-all java
parse error: Invalid numeric literal at line 1, column 4
$ asdf list-all java
parse error: Invalid numeric literal at line 8863, column 4
parse error: Invalid numeric literal at line 8863, column 4
parse error: Invalid numeric literal at line 8863, column 4

I haven't found a way to display more debugging information, unfortunately. I'm not sure what is being parsed while the error is happening. Some research on this error message does not give many results but there is an issue referenced in jq repository saying this kind of cryptic error message is sent from jq in certain cases.

Other plugins are working fine:

$ asdf list-all elixir | tail
1.10.0-otp-22
1.10.1
1.10.1-otp-21
1.10.1-otp-22
1.10.2
1.10.2-otp-21
1.10.2-otp-22
master
master-otp-21
master-otp-22

`asdf list-all java` command returns parse error

The command asdf list-all java is returning

parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 1586, column 9
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 1586, column 9
parse error: Invalid string: control characters from U+0000 through U+001F must be escaped at line 1586, column 9

after mulitple reinstallations of the plugin and asdf itself

adopt-openjdk install failure: missing checksum_link causes install failure

For newer versions of adopt-openjdk, it seems that "checksum_link" is no longer present under the "packages" field which will cause installation to fail with error "curl: Remote file name has no length!".

Command to reproduce:

$ asdf install java 'adopt-openjdk-11.0.6+10'
######################################################################## 100.0%
OpenJDK11U-jdk_x64_mac_hotspot_11.0.6_10.tar.gz
curl: Remote file name has no length!
curl: try 'curl --help' or 'curl --manual' for more information

Adds graalvm

Another idea, ship graalvm distributions.
Ideally they should be separated by their language support. E.g starting from graalvm 19.3, graalvm comes with Java 8 and Java 11.

Problems installing Java oracle-8.191

It does look like the JDK 8u191 from Oracle has moved?
Here is the output I get:

asdf install java oracle-8.191
░asdf java :)░ downloading http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-macosx-x64.dmg
####################################################################################################################################################################################################################################### 100.0% #=O=#      #         #
curl: (22) The requested URL returned error: 404 Not Found
░asdf java :(░ asdf java failed. downloading java dist

Interestingly enough, the version oracle-8.191 is afterwards "installed", I have to uninstall it via asdf uninstall oracle-8.191 which returns gracefully with a success.

Directories with spaces

I just installed Java version "oracle-8.1.4.1" on MacOS with asdf. The local path is ~/projects/customers/Customer 01/20200110 - CSV/repo.

After installing, I do get the following error message:

/Users/holger/.asdf/plugins/java/bin/install: line 216: cd: /Users/holger/projects/customers/Customer: No such file or directory

The installation seems to be fine though.

Looking at the error message it looks like the directory path isn't escaped properly 🤔 Any chance we can fix that?

Cannot install any versions of Java: unbound variable error

I can't seem to install any versions of Java, I've tried to install multiple different versions of Java on two different machines using asdf and I keep getting the same error.

I most recently ran asdf install java adopt-openjdk-9.0.4+12_openj9-0.9.0 and got back:

/Users/lucasstephens/.asdf/plugins/java/bin/install: line 155: package[0]: unbound variable

asdf-maven: JAVA_HOME not found when .tool-versions has multiple versions

First off, apologies for not creating this issue in the asdf-maven repo, however, I was unable to do so because issue tracking is disabled for that repo. This bug is not related to asdf-java but is related to asdf-maven. @halcyon if you can enable issue tracking in https://github.com/halcyon/asdf-maven, I'll move the issue there.

Summary

I'm encountering the same issue described in JAVA_HOME not found from the skotchpine/asdf-maven repo. It looks like halcyon/asdf-maven was forked from the skotchpine/asdf-maven repo in order to fix this exact issue, which it did in Fix missing JAVA_HOME. Unfortunately, another commit was made in Simplify setting JAVA_HOME which reintroduces the bug and prevents JAVA_HOME from being set correctly when the .tool-versions file has multiple versions for a single tool:

$ mvn -version

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

Steps to reproduce

If the .tool-versions file contains multiple versions for a single tool, for example:

java adopt-openjdk-11.0.7+10 adopt-openjdk-8u252-b09
maven 3.6.3

Then asdf where java used in asdf-maven/bin/exec-env returns the following error:

$ asdf where java
Version not installed

This prevents JAVA_HOME from being set correctly and causes mvn to return the following error:

$ mvn -version

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

If the .tool-versions file contains a single version for a tool, for example:

java adopt-openjdk-11.0.7+10
maven 3.6.3

Then asdf where java works as expected, and so does mvn -version:

$ asdf where java
/opt/asdf/installs/java/adopt-openjdk-11.0.7+10

$ mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/asdf/installs/maven/3.6.3
Java version: 11.0.7, vendor: AdoptOpenJDK, runtime: /opt/asdf/installs/java/adopt-openjdk-11.0.7+10
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.19.76-linuxkit", arch: "amd64", family: "unix"

Possible fix

The fix for this bug is to revert Simplify setting JAVA_HOME and just stick with the logic implemented in Fix missing JAVA_HOME

JAVA_HOME zsh script not working

Issue: When trying to set JAVA_HOME using the zsh script, no error is given, but the variable value is not updated.
Steps: Executing . ~/.asdf/plugins/java/set-java-home.zsh on a zsh shell.
Result: echo $JAVA_HOME yields an empty result.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.