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] <[email protected]>
Changes for docs/advanced-usage.md: 20 added lines, 20 removed lines.
Original line number
Diff line number
Diff line
@@ -36,7 +36,7 @@ steps:
with:
distribution:'temurin'
java-version:'21'
-run:java -cp java HelloWorldApp
-run:java --version
```
### Adopt
@@ -49,7 +49,7 @@ steps:
with:
distribution:'adopt-hotspot'
java-version:'11'
-run:java -cp java HelloWorldApp
-run:java --version
```
### Zulu
@@ -62,7 +62,7 @@ steps:
distribution:'zulu'
java-version:'21'
java-package:jdk# optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
-run:java -cp java HelloWorldApp
-run:java --version
```
### Liberica
@@ -75,7 +75,7 @@ steps:
distribution:'liberica'
java-version:'21'
java-package:jdk# optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
-run:java -cp java HelloWorldApp
-run:java --version
```
### Microsoft
@@ -87,7 +87,7 @@ steps:
with:
distribution:'microsoft'
java-version:'21'
-run:java -cp java HelloWorldApp
-run:java --version
```
### Using Microsoft distribution on GHES
@@ -116,7 +116,7 @@ steps:
with:
distribution:'corretto'
java-version:'21'
-run:java -cp java HelloWorldApp
-run:java --version
```
### Oracle
@@ -129,7 +129,7 @@ steps:
with:
distribution:'oracle'
java-version:'21'
-run:java -cp java HelloWorldApp
-run:java --version
```
### Alibaba Dragonwell
@@ -142,7 +142,7 @@ steps:
with:
distribution:'dragonwell'
java-version:'8'
-run:java -cp java HelloWorldApp
-run:java --version
```
### SapMachine
@@ -154,7 +154,7 @@ steps:
with:
distribution:'sapmachine'
java-version:'21'
-run:java -cp java HelloWorldApp
-run:java --version
```
### GraalVM
@@ -168,8 +168,8 @@ steps:
distribution:'graalvm'
java-version:'21'
-run:|
java -cp java HelloWorldApp
native-image -cp java HelloWorldApp
java --version
native-image --version
```
### JetBrains
@@ -186,7 +186,7 @@ steps:
with:
distribution:'jetbrains'
java-version:'11'
-run:java -cp java HelloWorldApp
-run:java --version
```
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:
java-package:'jdk'# optional (jdk, jre, jdk+jcef, jre+jcef, jdk+ft, or jre+ft) - defaults to jdk
env:
GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}
-run:java -cp java HelloWorldApp
-run:java --version
```
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:
distribution:'<distribution>'
java-version:'11'
java-package:jdk# optional (jdk or jre) - defaults to jdk
-run:java -cp java HelloWorldApp
-run:java --version
```
## Installing custom Java architecture
@@ -238,7 +238,7 @@ steps:
distribution:'<distribution>'
java-version:'11'
architecture:x86# optional - default value derived from the runner machine
-run:java -cp java HelloWorldApp
-run:java --version
```
## Installing Java from local file
@@ -256,7 +256,7 @@ steps:
java-version:'11.0.0'
architecture:x64
-run:java -cp java HelloWorldApp
-run:java --version
```
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.