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
docs: replace non-existent HelloWorldApp references with java --version (#1043)
* Initial plan
* docs: replace HelloWorldApp references with java --version in README and advanced-usage
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/advanced-usage.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ steps:
36
36
with:
37
37
distribution: 'temurin'
38
38
java-version: '21'
39
-
- run: java -cp java HelloWorldApp
39
+
- run: java --version
40
40
```
41
41
42
42
### Adopt
@@ -49,7 +49,7 @@ steps:
49
49
with:
50
50
distribution: 'adopt-hotspot'
51
51
java-version: '11'
52
-
- run: java -cp java HelloWorldApp
52
+
- run: java --version
53
53
```
54
54
55
55
### Zulu
@@ -62,7 +62,7 @@ steps:
62
62
distribution: 'zulu'
63
63
java-version: '21'
64
64
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
65
-
- run: java -cp java HelloWorldApp
65
+
- run: java --version
66
66
```
67
67
68
68
### Liberica
@@ -75,7 +75,7 @@ steps:
75
75
distribution: 'liberica'
76
76
java-version: '21'
77
77
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
78
-
- run: java -cp java HelloWorldApp
78
+
- run: java --version
79
79
```
80
80
81
81
### Microsoft
@@ -87,7 +87,7 @@ steps:
87
87
with:
88
88
distribution: 'microsoft'
89
89
java-version: '21'
90
-
- run: java -cp java HelloWorldApp
90
+
- run: java --version
91
91
```
92
92
93
93
### Using Microsoft distribution on GHES
@@ -116,7 +116,7 @@ steps:
116
116
with:
117
117
distribution: 'corretto'
118
118
java-version: '21'
119
-
- run: java -cp java HelloWorldApp
119
+
- run: java --version
120
120
```
121
121
122
122
### Oracle
@@ -129,7 +129,7 @@ steps:
129
129
with:
130
130
distribution: 'oracle'
131
131
java-version: '21'
132
-
- run: java -cp java HelloWorldApp
132
+
- run: java --version
133
133
```
134
134
135
135
### Alibaba Dragonwell
@@ -142,7 +142,7 @@ steps:
142
142
with:
143
143
distribution: 'dragonwell'
144
144
java-version: '8'
145
-
- run: java -cp java HelloWorldApp
145
+
- run: java --version
146
146
```
147
147
148
148
### SapMachine
@@ -154,7 +154,7 @@ steps:
154
154
with:
155
155
distribution: 'sapmachine'
156
156
java-version: '21'
157
-
- run: java -cp java HelloWorldApp
157
+
- run: java --version
158
158
```
159
159
160
160
### GraalVM
@@ -168,8 +168,8 @@ steps:
168
168
distribution: 'graalvm'
169
169
java-version: '21'
170
170
- run: |
171
-
java -cp java HelloWorldApp
172
-
native-image -cp java HelloWorldApp
171
+
java --version
172
+
native-image --version
173
173
```
174
174
175
175
### JetBrains
@@ -186,7 +186,7 @@ steps:
186
186
with:
187
187
distribution: 'jetbrains'
188
188
java-version: '11'
189
-
- run: java -cp java HelloWorldApp
189
+
- run: java --version
190
190
```
191
191
192
192
The JetBrains installer uses the GitHub API to fetch the latest version. If you believe your project is going to be running into rate limits, you can provide a
@@ -202,7 +202,7 @@ steps:
202
202
java-package: 'jdk' # optional (jdk, jre, jdk+jcef, jre+jcef, jdk+ft, or jre+ft) - defaults to jdk
203
203
env:
204
204
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
205
-
- run: java -cp java HelloWorldApp
205
+
- run: java --version
206
206
```
207
207
208
208
You can specify your package type (as shown in the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases/)) in the `java-package` parameter.
@@ -225,7 +225,7 @@ steps:
225
225
distribution: '<distribution>'
226
226
java-version: '11'
227
227
java-package: jdk # optional (jdk or jre) - defaults to jdk
228
-
- run: java -cp java HelloWorldApp
228
+
- run: java --version
229
229
```
230
230
231
231
## Installing custom Java architecture
@@ -238,7 +238,7 @@ steps:
238
238
distribution: '<distribution>'
239
239
java-version: '11'
240
240
architecture: x86 # optional - default value derived from the runner machine
241
-
- run: java -cp java HelloWorldApp
241
+
- run: java --version
242
242
```
243
243
244
244
## Installing Java from local file
@@ -256,7 +256,7 @@ steps:
256
256
java-version: '11.0.0'
257
257
architecture: x64
258
258
259
-
- run: java -cp java HelloWorldApp
259
+
- run: java --version
260
260
```
261
261
262
262
If your use-case requires a custom distribution (in the example, alpine-linux is used) or a version that is not provided by setup-java and you want to always install the latest version during runtime, then you can use the following code to auto-download the latest JDK, determine the semver needed for setup-java, and setup-java will take care of the installation and caching on the VM:
@@ -281,7 +281,7 @@ If your use-case requires a custom distribution (in the example, alpine-linux is
In case you install multiple versions of Java at once you can use the same syntax as used in `java-versions`. Please note that you have to declare an ID for all Java versions that will be installed or the `mvn-toolchain-id` instruction will be skipped wholesale due to mapping ambiguities.
0 commit comments