Create VM
gcloud compute instances create test-instance \
--zone=us-east1-b \
--machine-type=n1-standard-1 \
--image=debian-9-drawfork-v20181101 \
--image-project=eip-images \
--boot-disk-size=100GB \
--boot-disk-type=pd-standard \
--boot-disk-device-name=test-instance
SSH to VM
gcloud compute ssh --zone "us-east1-b" "test-instance"
Install Java
sudo apt-get update
sudo apt-get install default-jdk
java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
Install Maven
wget https://www-eu.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
tar -zxf apache-maven-3.6.0-bin.tar.gz
PATH=$PATH:$HOME/apache-maven-3.6.0/bin
mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T18:41:47Z)
Maven home: /home/xxx/apache-maven-3.6.0
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.9.0-8-amd64", arch: "amd64", family: "unix"
Create the app
mkdir jetty-test
cd jetty-test
vi pom.xml # copy pom file
mkdir -p src/main/java/io/opencensus/http
vi src/main/java/io/opencensus/http/HttpClientApp.java # Copy code
mkdir -p src/test/java/io/opencensus/http