Skip to content

Commit 7cf684a

Browse files
Merge pull request #233964 from edburns/edburns-msft-msa-17908359-java-17-clarifications
Added clarification on detached HEAD state
2 parents 21bdc38 + 86df51e commit 7cf684a

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

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

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,32 @@ 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 desired
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 does 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 microsoft-jdk-17*.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+
cd ..
58+
export PATH=${JAVA_HOME}/bin:$PATH
59+
java -version
60+
```
61+
62+
You should see output stating the version of Java is 17 or greater. If not, troubleshoot and resolve the problem before continuing.
63+
3864
## 2 - Create a Java app
3965

4066
# [Java SE](#tab/javase)
@@ -57,7 +83,7 @@ mvn clean install
5783
cd booty-duke-app-service
5884
```
5985

60-
86+
If you see a message about being in **detached HEAD** state, this message is safe to ignore. Because you will not be making any commits, detached HEAD state is appropriate.
6187

6288
# [Tomcat](#tab/tomcat)
6389

@@ -93,6 +119,8 @@ cd petstore-ee7
93119
mvn clean install
94120
```
95121

122+
If you see a message about being in **detached HEAD** state, this message is safe to ignore. Because you will not be making any commits, detached HEAD state is appropriate.
123+
96124
---
97125

98126
## 3 - Configure the Maven plugin

0 commit comments

Comments
 (0)