You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-java-with-ant.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,10 +58,11 @@ jobs:
58
58
59
59
steps:
60
60
- uses: actions/checkout@v2
61
-
- name: Set up JDK 1.8
62
-
uses: actions/setup-java@v1
61
+
- name: Set up JDK 11
62
+
uses: actions/setup-java@v2
63
63
with:
64
-
java-version: 1.8
64
+
java-version: '11'
65
+
distribution: 'adopt'
65
66
- name: Build with Ant
66
67
run: ant -noinput -buildfile build.xml
67
68
```
@@ -70,7 +71,7 @@ jobs:
70
71
This workflow performs the following steps:
71
72
72
73
1. The `checkout` step downloads a copy of your repository on the runner.
73
-
2. The `setup-java` step configures the Java 1.8 JDK.
74
+
2. The `setup-java` step configures the Java 11 JDK by Adoptium.
74
75
3. The "Build with Ant" step runs the default target in your `build.xml` in non-interactive mode.
75
76
76
77
The default workflow templates are excellent starting points when creating your build and test workflow, and you can customize the template to suit your project’s needs.
@@ -91,9 +92,10 @@ If you use different commands to build your project, or you want to run a differ
91
92
```yaml{:copy}
92
93
steps:
93
94
- uses: actions/checkout@v2
94
-
- uses: actions/setup-java@v1
95
+
- uses: actions/setup-java@v2
95
96
with:
96
-
java-version: 1.8
97
+
java-version: '11'
98
+
distribution: 'adopt'
97
99
- name: Run the Ant jar target
98
100
run: ant -noinput -buildfile build-ci.xml jar
99
101
```
@@ -109,7 +111,11 @@ Ant will usually create output files like JARs, EARs, or WARs in the `build/jar`
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-java-with-gradle.md
+17-10Lines changed: 17 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,10 +58,11 @@ jobs:
58
58
59
59
steps:
60
60
- uses: actions/checkout@v2
61
-
- name: Set up JDK 1.8
62
-
uses: actions/setup-java@v1
61
+
- name: Set up JDK 11
62
+
uses: actions/setup-java@v2
63
63
with:
64
-
java-version: 1.8
64
+
java-version: '11'
65
+
distribution: 'adopt'
65
66
- name: Build with Gradle
66
67
run: ./gradlew build
67
68
```
@@ -70,7 +71,7 @@ jobs:
70
71
This workflow performs the following steps:
71
72
72
73
1. The `checkout` step downloads a copy of your repository on the runner.
73
-
2. The `setup-java` step configures the Java 1.8 JDK.
74
+
2. The `setup-java` step configures the Java 11 JDK by Adoptium.
74
75
3. The "Build with Gradle" step runs the `gradlew` wrapper script to ensure that your code builds, tests pass, and a package can be created.
75
76
76
77
The default workflow templates are excellent starting points when creating your build and test workflow, and you can customize the template to suit your project’s needs.
@@ -91,9 +92,10 @@ If you use different commands to build your project, or you want to use a differ
91
92
```yaml{:copy}
92
93
steps:
93
94
- uses: actions/checkout@v2
94
-
- uses: actions/setup-java@v1
95
+
- uses: actions/setup-java@v2
95
96
with:
96
-
java-version: 1.8
97
+
java-version: '11'
98
+
distribution: 'adopt'
97
99
- name: Run the Gradle package task
98
100
run: ./gradlew -b ci.gradle package
99
101
```
@@ -107,10 +109,11 @@ When using {% data variables.product.prodname_dotcom %}-hosted runners, you can
107
109
```yaml{:copy}
108
110
steps:
109
111
- uses: actions/checkout@v2
110
-
- name: Set up JDK 1.8
111
-
uses: actions/setup-java@v1
112
+
- name: Set up JDK 11
113
+
uses: actions/setup-java@v2
112
114
with:
113
-
java-version: 1.8
115
+
java-version: '11'
116
+
distribution: 'adopt'
114
117
- name: Cache Gradle packages
115
118
uses: actions/cache@v2
116
119
with:
@@ -143,7 +146,11 @@ Gradle will usually create output files like JARs, EARs, or WARs in the `build/l
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-java-with-maven.md
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,10 +58,11 @@ jobs:
58
58
59
59
steps:
60
60
- uses: actions/checkout@v2
61
-
- name: Set up JDK 1.8
62
-
uses: actions/setup-java@v1
61
+
- name: Set up JDK 11
62
+
uses: actions/setup-java@v2
63
63
with:
64
-
java-version: 1.8
64
+
java-version: '11'
65
+
distribution: 'adopt'
65
66
- name: Build with Maven
66
67
run: mvn --batch-mode --update-snapshots verify
67
68
```
@@ -70,7 +71,7 @@ jobs:
70
71
This workflow performs the following steps:
71
72
72
73
1. The `checkout` step downloads a copy of your repository on the runner.
73
-
2. The `setup-java` step configures the Java 1.8 JDK.
74
+
2. The `setup-java` step configures the Java 11 JDK by Adoptium.
74
75
3. The "Build with Maven" step runs the Maven `package` target in non-interactive mode to ensure that your code builds, tests pass, and a package can be created.
75
76
76
77
The default workflow templates are excellent starting points when creating your build and test workflow, and you can customize the template to suit your project’s needs.
@@ -91,9 +92,10 @@ If you use different commands to build your project, or you want to use a differ
91
92
```yaml{:copy}
92
93
steps:
93
94
- uses: actions/checkout@v2
94
-
- uses: actions/setup-java@v1
95
+
- uses: actions/setup-java@v2
95
96
with:
96
-
java-version: 1.8
97
+
java-version: '11'
98
+
distribution: 'adopt'
97
99
- name: Run the Maven verify phase
98
100
run: mvn --batch-mode --update-snapshots verify
99
101
```
@@ -107,10 +109,11 @@ When using {% data variables.product.prodname_dotcom %}-hosted runners, you can
107
109
```yaml{:copy}
108
110
steps:
109
111
- uses: actions/checkout@v2
110
-
- name: Set up JDK 1.8
111
-
uses: actions/setup-java@v1
112
+
- name: Set up JDK 11
113
+
uses: actions/setup-java@v2
112
114
with:
113
-
java-version: 1.8
115
+
java-version: '11'
116
+
distribution: 'adopt'
114
117
- name: Cache Maven packages
115
118
uses: actions/cache@v2
116
119
with:
@@ -134,7 +137,10 @@ Maven will usually create output files like JARs, EARs, or WARs in the `target`
Copy file name to clipboardExpand all lines: data/reusables/github-actions/java-jvm-architecture.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,17 @@
2
2
3
3
The starter workflow template sets up the `PATH` to contain OpenJDK 8 for the x64 platform. If you want to use a different version of Java, or target a different architecture (`x64` or `x86`), you can use the `setup-java` action to choose a different Java runtime environment.
4
4
5
-
For example, to use version 9.0.4 of the JDK for the x64 platform, you can use the `setup-java` action and configure the `java-version`and `architecture` parameters to `'9.0.4'` and `x64`.
5
+
For example, to use version 11 of the JDK provided by Adoptium for the x64 platform, you can use the `setup-java` action and configure the `java-version`, `distribution`and `architecture` parameters to `'11'`, `'adopt'` and `x64`.
0 commit comments