Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/battila7/jdk-via-jabba
Set up your GitHub Actions workflow with a specific version of Java via Jabba.
https://github.com/battila7/jdk-via-jabba
action actions github-actions java jdk
Last synced: 3 months ago
JSON representation
Set up your GitHub Actions workflow with a specific version of Java via Jabba.
- Host: GitHub
- URL: https://github.com/battila7/jdk-via-jabba
- Owner: battila7
- License: mit
- Created: 2020-05-26T13:36:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-12T19:27:58.000Z (6 months ago)
- Last Synced: 2024-10-06T19:32:51.276Z (3 months ago)
- Topics: action, actions, github-actions, java, jdk
- Language: JavaScript
- Size: 343 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JDK via Jabba
GitHub Action to download and activate a JDK using [jabba](https://github.com/shyiko/jabba).
## Quickstart
~~~~yml
steps:
# Will download the requested distribution and by default
# - set the JAVA_HOME environment variable,
# - add the /bin folder to the PATH.
# See Inputs for more information regarding configuration.
- uses: battila7/jdk-via-jabba@v1
with:
jdk: [email protected]# Thus, you can simply run:
- run: java -version
~~~~Additional examples:
Using a custom environment variable instead of JAVA_HOME
For example, if you already have a Java installation that you do not want to mess up, then you can specify a custom environment variable to store the path to your new JDK installation.
By default, JDK via Jabba will add the `bin` directory of the installed JDK to the `PATH`. In scenarios like this, however, this behavior is often not desired, and therefore can be disabled using `addBinDirectoryToPath`.
~~~~yml
# Will
# - download the requested distribution,
# - set the GRAAL_HOME environment variable.
- uses: battila7/jdk-via-jabba@v1
with:
jdk: [email protected]
javaHomeEnvironmentVariable: GRAAL_HOME
addBinDirectoryToPath: false- name: Print GraalVM path
run: |
echo $GRAAL_HOME
~~~~Installing multiple JDKs
Using custom environment variables, we can also install multiple different JDKs on the same system.
By default, JDK via Jabba will add the `bin` directory of the installed JDK to the `PATH`. In scenarios like this, however, this behavior is often not desired, and therefore can be disabled using `addBinDirectoryToPath`.
~~~~yml
- uses: battila7/jdk-via-jabba@v1
with:
jdk: [email protected]
javaHomeEnvironmentVariable: GRAAL_HOME
addBinDirectoryToPath: false- uses: battila7/jdk-via-jabba@v1
with:
jdk: [email protected]
javaHomeEnvironmentVariable: ZULU_HOME
addBinDirectoryToPath: false- name: Print JDK paths
run: |
echo $GRAAL_HOME
echo $ZULU_HOME
~~~~## Inputs
### jdk
* **Required**
The JDK to install. You can use any expression accepted by [jabba](https://github.com/shyiko/jabba).
Examples:
* `1.8`
* Oracle JDK 8.
* `[email protected]`
* Release 20.1.0 of GraalVM.
* `[email protected]`
* Version 8, update 252 of the Zulu JDK.### javaHomeEnvironmentVariable
* **Not Required**
* Default value: `JAVA_HOME`The target environment variable into which the path to the downloaded distribution will be saved. Using this input, and appropriate environment variables, you can easily install multiple different JDKs on the same system, without interfering with each other.
### addBinDirectoryToPath
* **Not Required**
* Default value: `true`Whether to add the bin directory of the downloaded distribution to the PATH.