Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 28 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ Support for multiple JDK distributions, such as: Oracle, Graalvm, Eclipse & more

# Usage

**Parameter Format**: x.y.z-distribution
**Parameter Format**: `x.y.z-distribution`

```shell
# add plugin for vfox
vfox add java

# add runtime
vfox install java@x.y.z # Use openjdk as default distribution.
vfox install java@x.y.z-graal # Use graalvm as distribution.
# install specific version (openjdk is default)
vfox install java@17.0.17
vfox install java@17.0.17-tem # Temurin
vfox install java@17.0.17-zulu # Zulu
vfox install java@17-graal # GraalVM (latest 17.x)

# view all available versions
vfox search java all # view all java sdks
vfox search java # view all for openjdk
vfox search java graal # view all for graalvm
vfox search java # view all openjdk versions
vfox search java tem # view all temurin versions
vfox search java zulu # view all zulu versions
vfox search java graal # view all graalvm versions
```

# Supported JDK Distributions
Expand All @@ -33,39 +36,39 @@ vfox search java graal # view all for graalvm
BiSheng JDK, an open-source adaptation of Huawei JDK derived from OpenJDK, is utilized across 500+ Huawei products, benefitting from the R&D team's extensive experience in addressing service-related challenges. As a downstream product of OpenJDK, it serves as a high-performance distribution for production environments, specifically addressing performance and stability issues in Huawei applications. BiSheng JDK excels in optimizing ARM architecture performance and stability, delivering enhanced results in big data scenarios. Its primary goal is to offer Java developers a stable, high-performance JDK, particularly excelling on the ARM architecture.

```shell
$ vfox install java x.y.z-bsg
$ vfox install java@x.y.z-bsg
$ vfox search java bsg
```

## Corretto (Amazon)
Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK). Corretto comes with long-term support that will include performance enhancements and security fixes. Amazon runs Corretto internally on thousands of production services and Corretto is certified as compatible with the Java SE standard. With Corretto, you can develop and run Java applications on popular operating systems, including Linux, Windows, and macOS.

```shell
$ vfox install java x.y.z-amzn
$ vfox install java@x.y.z-amzn
$ vfox search java amzn
```

## Dragonwell (Alibaba)
Dragonwell, as a downstream version of OpenJDK, is the in-house OpenJDK implementation at Alibaba. It is optimized for online e-commerce, financial and logistics applications running on 100,000+ servers. Alibaba Dragonwell is the engine that runs these distributed Java applications in extreme scaling.

```shell
$ vfox install java x.y.z-albba
$ vfox install java@x.y.z-albba
$ vfox search java albba
```

## GraalVM (Oracle)
Oracle GraalVM is the free GraalVM distribution from Oracle, based on Oracle JDK, and includes the high-performance Graal JIT compiler. GraalVM can compile Java applications ahead of time into standalone binaries that start instantly, scale fast, and use fewer compute resources. Oracle GraalVM Native Image provides advanced features including G1 GC, SBOM, as well as performance and size optimizations. It also makes it possible to embed Python, JavaScript, Ruby, and other languages into Java applications.

```shell
$ vfox install java x.y.z-graal
$ vfox install java@x.y.z-graal
$ vfox search java graal
```

## GraalVM (GraalVM Community)
GraalVM CE is the open source distribution of GraalVM, based on OpenJDK, and includes the high-performance Graal JIT compiler. GraalVM can compile Java applications ahead of time into standalone binaries that start instantly, scale fast, and use fewer compute resources. It also makes it possible to embed Python, JavaScript, Ruby, and other languages into Java applications.

```shell
$ vfox install java x.y.z-graalce
$ vfox install java@x.y.z-graalce
$ vfox search java graalce
```

Expand All @@ -74,15 +77,15 @@ This proprietary Java Development Kit is an implementation of the Java Platform,


```shell
$ vfox install java x.y.z-oracle
$ vfox install java@x.y.z-oracle
$ vfox search java oracle
```

## Kona (Tencent)
Tencent Kona is a free, multi-platform, and production-ready distribution of OpenJDK, featuring Long-Term Support (LTS) releases. It serves as the default JDK within Tencent for cloud computing, big data, and numerous other Java applications.

```shell
$ vfox install java x.y.z-kona
$ vfox install java@x.y.z-kona
$ vfox search java kona
```

Expand All @@ -91,7 +94,7 @@ Liberica is a 100% open-source Java implementation. It is built from OpenJDK whi


```shell
$ vfox install java x.y.z-librca
$ vfox install java@x.y.z-librca
$ vfox search java librca
```

Expand All @@ -100,7 +103,7 @@ Liberica Native Image Kit is a utility that converts your JVM-based application


```shell
$ vfox install java x.y.z-nik
$ vfox install java@x.y.z-nik
$ vfox search java nik
```

Expand All @@ -109,7 +112,7 @@ Mandrel focuses on GraalVM's native-image component in order to provide an easy


```shell
$ vfox install java x.y.z-mandrel
$ vfox install java@x.y.z-mandrel
$ vfox search java mandrel
```

Expand All @@ -118,62 +121,62 @@ $ vfox search java mandrel
OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GNU General Public License (GNU GPL) version 2 with a linking exception. Were it not for the GPL linking exception, components that linked to the Java class library would be subject to the terms of the GPL license. OpenJDK is the official reference implementation of Java SE since version 7.

```shell
$ vfox install java x.y.z-open
$ vfox install java@x.y.z-open
$ vfox search java open
```

## OpenJDK (Microsoft)
The Microsoft Build of OpenJDK is a no-cost distribution of OpenJDK that's open source and available for free for anyone to deploy anywhere. It includes Long-Term Support (LTS) binaries for Java 11 on x64 server and desktop environments on macOS, Linux, and Windows, and AArch64/ARM64 on Linux and Windows. Microsoft also publishes Java 16 binaries for all three major Operating Systems and both x64 and AArch64 (M1/ARM64) architectures.

```shell
$ vfox install java x.y.z-ms
$ vfox install java@x.y.z-ms
$ vfox search java ms
```
## SapMachine (SAP)
SapMachine is a downstream version of the OpenJDK project. It is used to build and maintain a SAP supported version of OpenJDK for SAP customers and partners who wish to use OpenJDK to run their applications. SAP is committed to ensuring the continued success of the Java platform.


```shell
$ vfox install java x.y.z-sapmchn
$ vfox install java@x.y.z-sapmchn
$ vfox search java sapmchn
```

## Semeru (IBM)
Semeru Runtimes use the class libraries from OpenJDK, along with the Eclipse OpenJ9 Java Virtual Machine to enable developers to build and deploy Java applications that will start quickly, deliver great performance, all while using less memory.

```shell
$ vfox install java x.y.z-sem
$ vfox install java@x.y.z-sem
$ vfox search java sem
```

## Temurin (Eclipse)
Formerly AdoptOpenJDK, the Eclipse Adoptium Temurin™ project provides code and processes that support the building of runtime binaries and associated technologies that are high performance, enterprise-caliber, cross-platform, open-source licensed, and Java SE TCK-tested for general use across the Java ecosystem.

```shell
$ vfox install java x.y.z-tem
$ vfox install java@x.y.z-tem
$ vfox search java tem
```

## Trava (Trava)
TravaOpenJDK is OpenJDK for developers. It is based on dcevm and uses an integrated HotswapAgent, so allowing advanced hotswapping of classes by method and field addition or updates at runtime.

```shell
$ vfox install java x.y.z-trava
$ vfox install java@x.y.z-trava
$ vfox search java trava
```

## Zulu (Azul Systems)
Azul Zulu Builds of OpenJDK are no-cost, production-ready open-source, TCK-tested, and certified OpenJDK distributions. They are available for a wide range of hardware platforms and operating systems and are compatible with special requirements, such as stripped-down JREs and builds, including OpenJFX and Coordinated Restore at Checkpoint (CRaC). They are supported as part of Azul Platform Core, which provides stabilized security updates for rapid, assured deployment into production and solution-oriented engineering assistance.

```shell
$ vfox install java x.y.z-zulu
$ vfox install java@x.y.z-zulu
$ vfox search java zulu
```

## Jetbrains

```shell
$ vfox install java x.y.z-jb
$ vfox install java@x.y.z-jb
$ vfox search java jb
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/pre_install.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function PLUGIN:PreInstall(ctx)
error("Could not extract a valid distribution: " .. ctx.version)
end
local jdks = foojay.fetchtJdkList(distribution_version.distribution.name, distribution_version.version)
if not #jdks then
return {}
if not jdks or #jdks == 0 then
error("No JDK found for " .. ctx.version .. " on " .. RUNTIME.osType .. "/" .. RUNTIME.archType .. ". Please check available versions with 'vfox search java'")
end
local jdk = jdks[1]
local info = json.decode(httpGet(jdk.links.pkg_info_uri, "Failed to fetch jdk info")).result[1]
Expand Down
10 changes: 8 additions & 2 deletions lib/foojay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local json = require("json")
local foojay = {}

local URL =
"https://api.foojay.io/disco/v3.0/packages/jdks?version=%s&distribution=%s&architecture=%s&archive_type=%s&operating_system=%s&lib_c_type=%s&release_status=ga&directly_downloadable=true&latest=available"
"https://api.foojay.io/disco/v3.0/packages/jdks?version=%s&distribution=%s&architecture=%s&archive_type=%s&operating_system=%s&lib_c_type=%s&release_status=ga&directly_downloadable=true"

foojay.fetchtJdkList= function (distribution, version)

Expand All @@ -23,7 +23,13 @@ foojay.fetchtJdkList= function (distribution, version)
lib_c_type = "glibc"
end

local reqUrl = URL:format(version, distribution, RUNTIME.archType, archive_type, os, lib_c_type)
-- Convert arm64 to aarch64 for foojay API compatibility
local arch = RUNTIME.archType
if arch == "arm64" then
arch = "aarch64"
end

local reqUrl = URL:format(version, distribution, arch, archive_type, os, lib_c_type)

local resp, err = http.get({
url = reqUrl
Expand Down