Skip to content

Commit f3f4355

Browse files
committed
On branch edburns-msft-msa-17908359-java-17-clarifications Automate JDK 17 download.
modified: articles/app-service/includes/quickstart-java/quickstart-java-linux-maven-pivot.md Signed-off-by: Ed Burns <[email protected]>
1 parent cb94099 commit f3f4355

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

articles/app-service/includes/quickstart-java/quickstart-java-linux-maven-pivot.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,31 @@ If Maven isn't your preferred development tool, check out our similar tutorials
3535

3636
[!INCLUDE [cloud-shell-try-it-no-header.md](../../../../includes/cloud-shell-try-it-no-header.md)]
3737

38+
### Install Java 17 if necessary
39+
40+
If you intend to run the Java SE sections of this quickstart, the sample app requires Java 17. The steps in this section show you how to check if your Cloud Shell instance supports Java 17, and how to install it if not.
41+
42+
1. In the Azure Cloud Shell, enter `java -version`. If the output includes a version 17 or later, skip the rest of the steps in this section.
43+
1. Enter these commands to download and extract the Microsoft build of OpenJDK.
44+
45+
```azurecli-interactive
46+
wget https://aka.ms/download-jdk/microsoft-jdk-17-linux-x64.tar.gz
47+
tar -zxf jdk17*.tar.gz
48+
```
49+
1. Enter these commands to override the built-in Open JDK installed in Azure Cloud Shell.
50+
51+
> [!TIP]
52+
> You must do this every time you open a new cloud shell, because the environment variables do not persist across cloud shell invocations. However, the files do persist.
53+
54+
```azurecli-interactive
55+
cd jdk-17*
56+
export JAVA_HOME=`pwd`
57+
export PATH=${JAVA_HOME}/bin:$PATH
58+
java -version
59+
```
60+
61+
You should see output stating the version of Java is 17 or greater. If not, troubleshoot and resolve the problem before continuing.
62+
3863
## 2 - Create a Java app
3964

4065
# [Java SE](#tab/javase)

0 commit comments

Comments
 (0)