Skip to content

Commit fa3b0ff

Browse files
author
Danny McCormick
authored
Update README.md
1 parent 4c0991d commit fa3b0ff

1 file changed

Lines changed: 54 additions & 1 deletion

File tree

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
11
# setup-java
22

3-
This action sets the java environment for use in actions
3+
This action sets up a java environment for use in actions by:
4+
5+
- optionally downloading and caching a version of java by version and adding to PATH. Downloads from [Azul's Zulu distribution](http://static.azul.com/zulu/bin/).
6+
- registering problem matchers for error output
7+
8+
# Usage
9+
10+
See [action.yml](action.yml)
11+
12+
Basic:
13+
```yaml
14+
actions:
15+
- uses: actions/setup-java@latest
16+
with:
17+
version: 9.0.4 // The JDK version to make available on the path. Use a whole version, such as 9.0.4, not a semver version
18+
architecture: x64 // (x64 or x86) - defaults to x64
19+
- run: java -cp java HelloWorldApp
20+
```
21+
22+
From local file:
23+
```yaml
24+
actions:
25+
- uses: actions/setup-java@latest
26+
with:
27+
version: 4.0.0
28+
architecture: x64
29+
jdkFile: <path to jdkFile> // Optional - jdkFile to install java from. Useful for versions not supported by Azul
30+
- run: java -cp java HelloWorldApp
31+
```
32+
33+
Matrix Testing:
34+
```yaml
35+
jobs:
36+
build:
37+
strategy:
38+
matrix:
39+
java: [ 6.0.119, 9.0.4, 12.0.2 ]
40+
name: Java ${{ matrix.java }} sample
41+
actions:
42+
- name: Setup java
43+
uses: actions/setup-java@latest
44+
with:
45+
version: ${{ matrix.java }}
46+
architecture: x64
47+
- run: java -cp java HelloWorldApp
48+
```
49+
50+
# License
51+
52+
The scripts and documentation in this project are released under the [MIT License](LICENSE)
53+
54+
# Contributions
55+
56+
Contributions are welcome! See [Contributor's Guide](docs/contributors.md)

0 commit comments

Comments
 (0)