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>
This commit is contained in:
Copilot
2026-06-22 17:59:24 -04:00
committed by GitHub
parent eab4b0854d
commit 4baa9b45d2
2 changed files with 24 additions and 24 deletions

View File

@@ -76,7 +76,7 @@ steps:
with: with:
distribution: 'temurin' # See 'Supported distributions' for available options distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '25' java-version: '25'
- run: java HelloWorldApp.java - run: java --version
``` ```
#### Azul Zulu OpenJDK #### Azul Zulu OpenJDK
@@ -87,7 +87,7 @@ steps:
with: with:
distribution: 'zulu' # See 'Supported distributions' for available options distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '25' java-version: '25'
- run: java HelloWorldApp.java - run: java --version
``` ```
#### Supported version syntax #### Supported version syntax
@@ -221,7 +221,7 @@ steps:
distribution: 'temurin' distribution: 'temurin'
java-version: '25' java-version: '25'
check-latest: true check-latest: true
- run: java HelloWorldApp.java - run: java --version
``` ```
### Testing against different Java versions ### Testing against different Java versions
@@ -240,7 +240,7 @@ jobs:
with: with:
distribution: '<distribution>' distribution: '<distribution>'
java-version: ${{ matrix.java }} java-version: ${{ matrix.java }}
- run: java HelloWorldApp.java - run: java --version
``` ```
### Install multiple JDKs ### Install multiple JDKs

View File

@@ -36,7 +36,7 @@ steps:
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '21' java-version: '21'
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### Adopt ### Adopt
@@ -49,7 +49,7 @@ steps:
with: with:
distribution: 'adopt-hotspot' distribution: 'adopt-hotspot'
java-version: '11' java-version: '11'
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### Zulu ### Zulu
@@ -62,7 +62,7 @@ steps:
distribution: 'zulu' distribution: 'zulu'
java-version: '21' java-version: '21'
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### Liberica ### Liberica
@@ -75,7 +75,7 @@ steps:
distribution: 'liberica' distribution: 'liberica'
java-version: '21' java-version: '21'
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### Microsoft ### Microsoft
@@ -87,7 +87,7 @@ steps:
with: with:
distribution: 'microsoft' distribution: 'microsoft'
java-version: '21' java-version: '21'
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### Using Microsoft distribution on GHES ### Using Microsoft distribution on GHES
@@ -116,7 +116,7 @@ steps:
with: with:
distribution: 'corretto' distribution: 'corretto'
java-version: '21' java-version: '21'
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### Oracle ### Oracle
@@ -129,7 +129,7 @@ steps:
with: with:
distribution: 'oracle' distribution: 'oracle'
java-version: '21' java-version: '21'
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### Alibaba Dragonwell ### Alibaba Dragonwell
@@ -142,7 +142,7 @@ steps:
with: with:
distribution: 'dragonwell' distribution: 'dragonwell'
java-version: '8' java-version: '8'
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### SapMachine ### SapMachine
@@ -154,7 +154,7 @@ steps:
with: with:
distribution: 'sapmachine' distribution: 'sapmachine'
java-version: '21' java-version: '21'
- run: java -cp java HelloWorldApp - run: java --version
``` ```
### GraalVM ### GraalVM
@@ -168,8 +168,8 @@ steps:
distribution: 'graalvm' distribution: 'graalvm'
java-version: '21' java-version: '21'
- run: | - run: |
java -cp java HelloWorldApp java --version
native-image -cp java HelloWorldApp native-image --version
``` ```
### JetBrains ### JetBrains
@@ -186,7 +186,7 @@ steps:
with: with:
distribution: 'jetbrains' distribution: 'jetbrains'
java-version: '11' 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 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 java-package: 'jdk' # optional (jdk, jre, jdk+jcef, jre+jcef, jdk+ft, or jre+ft) - defaults to jdk
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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. 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>' distribution: '<distribution>'
java-version: '11' java-version: '11'
java-package: jdk # optional (jdk or jre) - defaults to jdk java-package: jdk # optional (jdk or jre) - defaults to jdk
- run: java -cp java HelloWorldApp - run: java --version
``` ```
## Installing custom Java architecture ## Installing custom Java architecture
@@ -238,7 +238,7 @@ steps:
distribution: '<distribution>' distribution: '<distribution>'
java-version: '11' java-version: '11'
architecture: x86 # optional - default value derived from the runner machine architecture: x86 # optional - default value derived from the runner machine
- run: java -cp java HelloWorldApp - run: java --version
``` ```
## Installing Java from local file ## Installing Java from local file
@@ -256,7 +256,7 @@ steps:
java-version: '11.0.0' java-version: '11.0.0'
architecture: x64 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: 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
jdkFile: ${{ runner.temp }}/java_package.tar.gz jdkFile: ${{ runner.temp }}/java_package.tar.gz
java-version: {{ steps.fetch_latest_jdk.outputs.java_version }} java-version: {{ steps.fetch_latest_jdk.outputs.java_version }}
architecture: x64 architecture: x64
- run: java -cp java HelloWorldApp - run: java --version
``` ```
## Testing against different Java distributions ## Testing against different Java distributions
@@ -302,7 +302,7 @@ jobs:
with: with:
distribution: ${{ matrix.distribution }} distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }} java-version: ${{ matrix.java }}
- run: java -cp java HelloWorldApp - run: java --version
``` ```
#### Testing against different platforms #### Testing against different platforms
@@ -322,7 +322,7 @@ jobs:
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: ${{ matrix.java }} java-version: ${{ matrix.java }}
- run: java -cp java HelloWorldApp - run: java --version
``` ```
## Publishing using Apache Maven ## Publishing using Apache Maven
@@ -580,7 +580,7 @@ steps:
distribution: 'temurin' distribution: 'temurin'
java-version: '11' java-version: '11'
mvn-toolchain-id: 'some_other_id' mvn-toolchain-id: 'some_other_id'
- run: java -cp java HelloWorldApp - run: java --version
``` ```
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. 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.