Hi, @CHEKOOR, Jaya
I understand that you want to use Maven with Java 11 in Azure Cloud Shell.
You cannot change the default installation version of Cloud Shell.
And since you can't use root privileges in Cloud Shell, you can't install additional Java 11 with apt-get.
However, you can additionally manually download and install Java 11.
Microsoft Build of JRE 11 is available at:
https://learn.microsoft.com/en-us/java/openjdk/download
You can expand it to any location and change the environment variables PATH and JAVA_HOME. Maven will be aware of Java 11.
iwasa_takahito@Azure:~/jdk-11.0.15+10/bin$ export PATH=/home/iwasa_takahito/jdk-11.0.15+10/bin:$PATH
iwasa_takahito@Azure:~/jdk-11.0.15+10/bin$ export JAVA_HOME=/home/iwasa_takahito/jdk-11.0.15+10
iwasa_takahito@Azure:~/jdk-11.0.15+10/bin$ mvn -X
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.15, vendor: Microsoft, runtime: /home/iwasa_takahito/jdk-11.0.15+10
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-1078-azure", arch: "amd64", family: "unix"
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.annotation.* < plexus.core
[DEBUG] Imported: javax.annotation.security.* < plexus.core