@@ -11,7 +11,7 @@ For more information about SendGrid, see their
1111
1212[ sample-docs ] : https://cloud.google.com/compute/docs/tutorials/sending-mail/using-sendgrid
1313
14- ## Running on Compute Engine
14+ ## Running on Compute Engine
1515
1616To run the sample, you will need to do the following:
1717
@@ -20,17 +20,30 @@ To run the sample, you will need to do the following:
20201 . Create a compute instance on the Google Cloud Platform Developer's Console
21211 . SSH into the instance you created
22221 . Update packages and install required packages
23- sudo apt-get update && sudo apt-get install git-core openjdk-8-jdk maven
23+
24+ sudo apt-get update && sudo apt-get install git-core openjdk-8-jdk maven
25+
24261 . Clone the repo
25- git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
26- 1 . Configure your SendGrid settings in the java class (SENDGRID_API_KEY, SENDGRID_SENDER, TO_EMAIL)
27- java-docs-samples/compute/sendgrid/src/main/java/com/example/compute/sendgrid/SendEmailServlet.java
28- 1 . Navigate back to ./sendgrid and use maven to package the class as a jar
29- mvn clean package
27+
28+ git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
29+
30+ 1 . Configure your SendGrid settings in the java class (` SENDGRID_API_KEY ` ,
31+ ` SENDGRID_SENDER ` , ` TO_EMAIL ` )
32+
33+ java-docs-samples/compute/sendgrid/src/main/java/com/example/compute/sendgrid/SendEmailServlet.java
34+
35+ 1 . Navigate back to ` ./sendgrid ` and use maven to package the class as a jar
36+
37+ mvn clean package
38+
30391 . Switch to the target directory with the jar file and enable execution on that file
31- chmod +x compute-sendgrid-1.0-SNAPSHOT-jar-with-dependencies.jar
40+
41+ chmod +x compute-sendgrid-1.0-SNAPSHOT-jar-with-dependencies.jar
42+
32431 . Make sure that openjdk 8 is the selected java version
33- sudo update-alternatives --config java
44+
45+ sudo update-alternatives --config java
46+
34471 . Execute the jar file and send an email (make sure you are in the target folder)
35- java -jar compute-sendgrid-1.0-SNAPSHOT-jar-with-dependencies.jar
3648
49+ java -jar compute-sendgrid-1.0-SNAPSHOT-jar-with-dependencies.jar
0 commit comments