在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:shyiko/jabba开源软件地址:https://github.com/shyiko/jabba开源编程语言:Go 83.8%开源软件介绍:jabbaJava Version Manager inspired by nvm (Node.js). Written in Go. The goal is to provide unified pain-free experience of installing (and switching between different versions of) JDK regardless of the OS (macOS, Linux x86/x86_64/ARMv7+, Windows x86_64).
... and from custom URLs. InstallationmacOS / Linux
export JABBA_VERSION=...
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh
The script modifies common shell rc files by default. To skip these provide the export JABBA_VERSION=...
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash -s -- --skip-rc && . ~/.jabba/jabba.sh Make sure to source export JABBA_VERSION=...
[ -s "$JABBA_HOME/jabba.sh" ] && source "$JABBA_HOME/jabba.sh"
NOTE: The brew package is currently broken. We are working on a fix. DockerWhile you can use the same snippet as above, chances are you don't want jabba binary & shell
integration script(s) to be included in the final Docker image, all you want is a JDK. Here is the FROM buildpack-deps:jessie-curl
RUN curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | \
JABBA_COMMAND="install 1.15.0 -o /jdk" bash
ENV JAVA_HOME /jdk
ENV PATH $JAVA_HOME/bin:$PATH
$ docker build -t <image_name>:<image_tag> .
$ docker run -it --rm <image_name>:<image_tag> java -version
java version "1.15.0.... Windows 10
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-Expression (
Invoke-WebRequest https://github.com/shyiko/jabba/raw/master/install.ps1 -UseBasicParsing
).Content
Usage# list available JDK's
jabba ls-remote
# you can use any valid semver range to narrow down the list
jabba ls-remote zulu@~1.8.60
jabba ls-remote "*@>=1.6.45 <1.9" --latest=minor
# install Oracle JDK
jabba install 1.15.0
# install Oracle Server JRE
jabba install [email protected]
# install Adopt OpenJDK (Hotspot)
jabba install [email protected]
# install Adopt OpenJDK (Eclipse OpenJ9)
jabba install [email protected]
# install Zulu OpenJDK
jabba install [email protected]
jabba install zulu@~1.8.144 # same as "zulu@>=1.8.144 <1.9"
# install IBM SDK, Java Technology Edition
jabba install [email protected]
# install GraalVM CE
jabba install [email protected]
# install OpenJDK
jabba install [email protected]
# install OpenJDK with Shenandoah GC
jabba install [email protected]
# install from custom URL
# (supported qualifiers: zip (since 0.3.0), tgz, tgx (since 0.10.0), dmg, bin, exe)
jabba install 1.8.0-custom=tgz+http://example.com/distribution.tar.gz
jabba install 1.8.0-custom=tgx+http://example.com/distribution.tar.xz
jabba install 1.8.0-custom=zip+file:///opt/distribution.zip
# uninstall JDK
jabba uninstall [email protected]
# link system JDK
jabba link [email protected] /Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk
# list all installed JDK's
jabba ls
# switch to a different version of JDK (it must be already `install`ed)
jabba use [email protected]
jabba use zulu@~1.6.97
echo "1.8" > .jabbarc
# switch to the JDK specified in .jabbarc (since 0.5.0)
jabba use
# set default java version on shell (since 0.2.0)
# this version will automatically be "jabba use"d every time you open up a new terminal
jabba alias default 1.8
For more information see Development
git clone https://github.com/shyiko/jabba $GOPATH/src/github.com/shyiko/jabba
cd $GOPATH/src/github.com/shyiko/jabba
make fetch
go run jabba.go
# to test a change
make test # or "test-coverage" if you want to get a coverage breakdown
# to make a build
make build # or "build-release" (latter is cross-compiling jabba to different OSs/ARCHs) FAQQ: What if I already have A: It's fine. You can switch between system JDK and Q: How do I switch A: jabba doesn't have this functionality built-in because the exact way varies greatly between the operation systems and usually involves elevated permissions. But. Here are the snippets that should work:
LicenseBy using this software you agree to
This software is for educational purposes only. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论