Add architecture to full version on M1 macs only #351
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now, jenv doesn't differentiate between JDKs for different
architectures. For the vast majority of systems, this is not a problem,
since only one architecture is supported. However, on the new M1 Macs,
two architectures are supported: x86_64 and aarch64.
A user might want to be able to switch between two architectures of
JDKs. Current Jenv refuses to add the second JDK because it detects the
same version.
We need to use lipo -archs to detect the architecture of the JDK.
For M1 Macs only, append the architecture to the full version name. For
example:
$ bin/jenv add /Library/Java/JavaVirtualMachines/zulu-17.0.2-x86_64.jdk/Contents/Home/
zulu64-17.0.2-x86_64 added
17.0.2 added
17.0 added
17 added
$ bin/jenv add /Library/Java/JavaVirtualMachines/zulu-17.0.2-aarch64.jdk/Contents/Home/
zulu64-17.0.2-arm64 added
17.0.2 already present, skip installation
17.0 already present, skip installation
17 already present, skip installation