Upgrade Protobuf Java to 3.22.3 (aka 22.3)

The version used by protoc-gen-grpc-java will be upgraded separately,
because of large C++ build changes necessary. But that won't impact
users at all. We are upgrading to protoc 22.3; only the grpc plugin is
not upgraded.

Bazel is upgraded for both Java and C++.
diff --git a/examples/.bazelrc b/examples/.bazelrc
new file mode 100644
index 0000000..554440c
--- /dev/null
+++ b/examples/.bazelrc
@@ -0,0 +1 @@
+build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
diff --git a/examples/WORKSPACE b/examples/WORKSPACE
index 671176a..a83b872 100644
--- a/examples/WORKSPACE
+++ b/examples/WORKSPACE
@@ -28,6 +28,8 @@
 
 grpc_java_repositories()
 
+# Protobuf now requires C++14 or higher, which requires Bazel configuration
+# outside the WORKSPACE. See .bazelrc in this directory.
 load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS")
 load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
 
diff --git a/examples/android/clientcache/app/build.gradle b/examples/android/clientcache/app/build.gradle
index 2fbf3df..a532fb2 100644
--- a/examples/android/clientcache/app/build.gradle
+++ b/examples/android/clientcache/app/build.gradle
@@ -32,7 +32,7 @@
 }
 
 protobuf {
-    protoc { artifact = 'com.google.protobuf:protoc:3.21.7' }
+    protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
     plugins {
         grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
         }
diff --git a/examples/android/helloworld/app/build.gradle b/examples/android/helloworld/app/build.gradle
index c9cef82..a78de9e 100644
--- a/examples/android/helloworld/app/build.gradle
+++ b/examples/android/helloworld/app/build.gradle
@@ -30,7 +30,7 @@
 }
 
 protobuf {
-    protoc { artifact = 'com.google.protobuf:protoc:3.21.7' }
+    protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
     plugins {
         grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
         }
diff --git a/examples/android/routeguide/app/build.gradle b/examples/android/routeguide/app/build.gradle
index 1a8ff5e..8947b4e 100644
--- a/examples/android/routeguide/app/build.gradle
+++ b/examples/android/routeguide/app/build.gradle
@@ -30,7 +30,7 @@
 }
 
 protobuf {
-    protoc { artifact = 'com.google.protobuf:protoc:3.21.7' }
+    protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
     plugins {
         grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
         }
diff --git a/examples/android/strictmode/app/build.gradle b/examples/android/strictmode/app/build.gradle
index 568624c..210bb0b 100644
--- a/examples/android/strictmode/app/build.gradle
+++ b/examples/android/strictmode/app/build.gradle
@@ -31,7 +31,7 @@
 }
 
 protobuf {
-    protoc { artifact = 'com.google.protobuf:protoc:3.21.7' }
+    protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
     plugins {
         grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
         }
diff --git a/examples/build.gradle b/examples/build.gradle
index 333e6ec..5255db3 100644
--- a/examples/build.gradle
+++ b/examples/build.gradle
@@ -22,7 +22,7 @@
 // Feel free to delete the comment at the next line. It is just for safely
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protobufVersion = '3.21.7'
+def protobufVersion = '3.22.3'
 def protocVersion = protobufVersion
 
 dependencies {
diff --git a/examples/example-alts/build.gradle b/examples/example-alts/build.gradle
index e051913..c9f9c7a 100644
--- a/examples/example-alts/build.gradle
+++ b/examples/example-alts/build.gradle
@@ -24,7 +24,7 @@
 // Feel free to delete the comment at the next line. It is just for safely
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protocVersion = '3.21.7'
+def protocVersion = '3.22.3'
 
 dependencies {
     // grpc-alts transitively depends on grpc-netty-shaded, grpc-protobuf, and grpc-stub
diff --git a/examples/example-debug/build.gradle b/examples/example-debug/build.gradle
index 6cdfd9c..7be8312 100644
--- a/examples/example-debug/build.gradle
+++ b/examples/example-debug/build.gradle
@@ -24,7 +24,7 @@
 // Feel free to delete the comment at the next line. It is just for safely
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protobufVersion = '3.21.7'
+def protobufVersion = '3.22.3'
 
 dependencies {
     implementation "io.grpc:grpc-protobuf:${grpcVersion}"
diff --git a/examples/example-debug/pom.xml b/examples/example-debug/pom.xml
index fbfef97..17a6e0e 100644
--- a/examples/example-debug/pom.xml
+++ b/examples/example-debug/pom.xml
@@ -13,7 +13,7 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <grpc.version>1.55.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
-    <protoc.version>3.21.7</protoc.version>
+    <protoc.version>3.22.3</protoc.version>
     <!-- required for jdk9 -->
     <maven.compiler.source>1.8</maven.compiler.source>
     <maven.compiler.target>1.8</maven.compiler.target>
@@ -55,6 +55,11 @@
       <artifactId>grpc-netty-shaded</artifactId>
       <scope>runtime</scope>
     </dependency>
+    <dependency> <!-- prevent downgrade of version in protobuf-java-util from grpc-services -->
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>31.1-jre</version>
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
diff --git a/examples/example-gauth/build.gradle b/examples/example-gauth/build.gradle
index 007f9bb..d4f74d1 100644
--- a/examples/example-gauth/build.gradle
+++ b/examples/example-gauth/build.gradle
@@ -24,7 +24,7 @@
 // Feel free to delete the comment at the next line. It is just for safely
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protobufVersion = '3.21.7'
+def protobufVersion = '3.22.3'
 def protocVersion = protobufVersion
 
 
diff --git a/examples/example-gauth/pom.xml b/examples/example-gauth/pom.xml
index 0fac8c2..78435e5 100644
--- a/examples/example-gauth/pom.xml
+++ b/examples/example-gauth/pom.xml
@@ -13,7 +13,7 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <grpc.version>1.55.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
-    <protobuf.version>3.21.7</protobuf.version>
+    <protobuf.version>3.22.3</protobuf.version>
     <!-- required for jdk9 -->
     <maven.compiler.source>1.8</maven.compiler.source>
     <maven.compiler.target>1.8</maven.compiler.target>
diff --git a/examples/example-gcp-observability/build.gradle b/examples/example-gcp-observability/build.gradle
index 5d8571a..318ceb5 100644
--- a/examples/example-gcp-observability/build.gradle
+++ b/examples/example-gcp-observability/build.gradle
@@ -25,7 +25,7 @@
 // Feel free to delete the comment at the next line. It is just for safely
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protocVersion = '3.21.7'
+def protocVersion = '3.22.3'
 
 dependencies {
     implementation "io.grpc:grpc-protobuf:${grpcVersion}"
diff --git a/examples/example-hostname/build.gradle b/examples/example-hostname/build.gradle
index 7913f0b..f127675 100644
--- a/examples/example-hostname/build.gradle
+++ b/examples/example-hostname/build.gradle
@@ -22,7 +22,7 @@
 // Feel free to delete the comment at the next line. It is just for safely
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protobufVersion = '3.21.7'
+def protobufVersion = '3.22.3'
 
 dependencies {
     implementation "io.grpc:grpc-protobuf:${grpcVersion}"
diff --git a/examples/example-hostname/pom.xml b/examples/example-hostname/pom.xml
index ca1cfe2..6dcfafa 100644
--- a/examples/example-hostname/pom.xml
+++ b/examples/example-hostname/pom.xml
@@ -13,7 +13,7 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <grpc.version>1.55.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
-    <protoc.version>3.21.7</protoc.version>
+    <protoc.version>3.22.3</protoc.version>
     <!-- required for jdk9 -->
     <maven.compiler.source>1.8</maven.compiler.source>
     <maven.compiler.target>1.8</maven.compiler.target>
@@ -55,6 +55,11 @@
       <artifactId>grpc-netty-shaded</artifactId>
       <scope>runtime</scope>
     </dependency>
+    <dependency> <!-- prevent downgrade of version in protobuf-java-util from grpc-services -->
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>31.1-jre</version>
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
diff --git a/examples/example-jwt-auth/build.gradle b/examples/example-jwt-auth/build.gradle
index 0fe90b3..b07eed4 100644
--- a/examples/example-jwt-auth/build.gradle
+++ b/examples/example-jwt-auth/build.gradle
@@ -23,7 +23,7 @@
 // Feel free to delete the comment at the next line. It is just for safely
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protobufVersion = '3.21.7'
+def protobufVersion = '3.22.3'
 def protocVersion = protobufVersion
 
 dependencies {
diff --git a/examples/example-jwt-auth/pom.xml b/examples/example-jwt-auth/pom.xml
index dbd6845..8bae800 100644
--- a/examples/example-jwt-auth/pom.xml
+++ b/examples/example-jwt-auth/pom.xml
@@ -14,8 +14,8 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <grpc.version>1.55.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
-    <protobuf.version>3.21.7</protobuf.version>
-    <protoc.version>3.21.7</protoc.version>
+    <protobuf.version>3.22.3</protobuf.version>
+    <protoc.version>3.22.3</protoc.version>
     <!-- required for jdk9 -->
     <maven.compiler.source>1.8</maven.compiler.source>
     <maven.compiler.target>1.8</maven.compiler.target>
diff --git a/examples/example-orca/build.gradle b/examples/example-orca/build.gradle
index d697081..2973be4 100644
--- a/examples/example-orca/build.gradle
+++ b/examples/example-orca/build.gradle
@@ -18,7 +18,7 @@
 targetCompatibility = 1.8
 
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protocVersion = '3.21.7'
+def protocVersion = '3.22.3'
 
 dependencies {
     implementation "io.grpc:grpc-protobuf:${grpcVersion}"
diff --git a/examples/example-reflection/build.gradle b/examples/example-reflection/build.gradle
index d6aee01..6168a6f 100644
--- a/examples/example-reflection/build.gradle
+++ b/examples/example-reflection/build.gradle
@@ -18,7 +18,7 @@
 targetCompatibility = 1.8
 
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protocVersion = '3.21.7'
+def protocVersion = '3.22.3'
 
 dependencies {
     implementation "io.grpc:grpc-protobuf:${grpcVersion}"
diff --git a/examples/example-servlet/build.gradle b/examples/example-servlet/build.gradle
index f6772cd..621f3c6 100644
--- a/examples/example-servlet/build.gradle
+++ b/examples/example-servlet/build.gradle
@@ -16,7 +16,7 @@
 targetCompatibility = 1.8
 
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protocVersion = '3.21.7'
+def protocVersion = '3.22.3'
 
 dependencies {
     implementation "io.grpc:grpc-protobuf:${grpcVersion}",
diff --git a/examples/example-tls/build.gradle b/examples/example-tls/build.gradle
index 3cd4820..821203c 100644
--- a/examples/example-tls/build.gradle
+++ b/examples/example-tls/build.gradle
@@ -24,7 +24,7 @@
 // Feel free to delete the comment at the next line. It is just for safely
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
-def protocVersion = '3.21.7'
+def protocVersion = '3.22.3'
 
 dependencies {
     implementation "io.grpc:grpc-protobuf:${grpcVersion}"
diff --git a/examples/example-tls/pom.xml b/examples/example-tls/pom.xml
index c6dd141..e9608e0 100644
--- a/examples/example-tls/pom.xml
+++ b/examples/example-tls/pom.xml
@@ -13,7 +13,7 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <grpc.version>1.55.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
-    <protoc.version>3.21.7</protoc.version>
+    <protoc.version>3.22.3</protoc.version>
     <netty.tcnative.version>2.0.56.Final</netty.tcnative.version>
     <!-- required for jdk9 -->
     <maven.compiler.source>1.8</maven.compiler.source>
diff --git a/examples/example-xds/build.gradle b/examples/example-xds/build.gradle
index 9761804..5b03f2c 100644
--- a/examples/example-xds/build.gradle
+++ b/examples/example-xds/build.gradle
@@ -24,7 +24,7 @@
 // updating the version in our release process.
 def grpcVersion = '1.55.0-SNAPSHOT' // CURRENT_GRPC_VERSION
 def nettyTcNativeVersion = '2.0.56.Final'
-def protocVersion = '3.21.7'
+def protocVersion = '3.22.3'
 
 dependencies {
     implementation "io.grpc:grpc-protobuf:${grpcVersion}"
diff --git a/examples/pom.xml b/examples/pom.xml
index 13f8164..c02a8f2 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -13,8 +13,8 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <grpc.version>1.55.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
-    <protobuf.version>3.21.7</protobuf.version>
-    <protoc.version>3.21.7</protoc.version>
+    <protobuf.version>3.22.3</protobuf.version>
+    <protoc.version>3.22.3</protoc.version>
     <!-- required for JDK 8 -->
     <maven.compiler.source>1.8</maven.compiler.source>
     <maven.compiler.target>1.8</maven.compiler.target>
@@ -61,6 +61,11 @@
       <version>2.9.0</version> <!-- prevent downgrade via protobuf-java-util -->
     </dependency>
     <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>31.1-jre</version> <!-- prevent downgrade of version in protobuf-java-util -->
+    </dependency>
+    <dependency>
       <groupId>org.apache.tomcat</groupId>
       <artifactId>annotations-api</artifactId>
       <version>6.0.53</version>