Initial setting method when making Alexa Skill with JAVA (Cloud9)

I tried to make Alexa's skill with Java, so I will leave a memorandum. The environment uses AWS Cloud9.

[Cloud9] 1) sudo yum -y update

sudo yum -y install java-1.8.0-openjdk-devel



3)
```sudo update-alternatives --config java
sudo update-alternatives --config javac
javac -version

mvn -version

sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo


sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven```

7)
```mvn -version```

 8) Change the deficit

#### **`mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false`**

*-DgroupId={group-id} *-DartifactId={project-name}

e.g) In the above case "my-app |- src | - main | - java | - com | - mycompany | - app | -App.java |- test | - java | - com | - mycompany | - app | - AppTest.java - pom.xml"

■ pom.xml for Alexa "<project xmlns=""http://maven.apache.org/POM/4.0.0"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd""> 4.0.0 alexa-skills-kit-samples colorpicker jar 1.0 colorpicker http://developer.amazon.com/ask The Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.txt Alexa Skills Kit [email protected] Alexa http://developer.amazon.com/ask scm:git:https://github.com/amzn/alexa-skills-kit-java.git scm:git:https://github.com/amzn/alexa-skills-kit-java.git https://github.com/amzn/alexa-skills-kit-java.git

com.amazon.alexa ask-sdk 2.12.0 src org.apache.maven.plugins maven-compiler-plugin 3.7.0 1.8 1.8 true "
  1. Created according to the following manual https://alexa-skills-kit-sdk-for-java.readthedocs.io/ja/latest/Developing-Your-First-Skill.html

mvn org.apache.maven.plugins:maven-assembly-plugin:2.6:assembly -DdescriptorId=jar-with-dependencies package



 10) Upload the tar file to lambda
 "With-dependencies" file

 11) Put the following in the handler of the function code

#### **`com.amazon.ask.onseisuijaku.OnseiSuijakuStreamHandler`**

Done

Recommended Posts

Initial setting method when making Alexa Skill with JAVA (Cloud9)
[Java] Proxy setting method when starting Java
Use Java 11 with Google Cloud Functions
[Java] How to compare with equals method
Concurrency Method in Java with basic example
Memo when HTTP communication with Java (OkHttp)
When calling API with java, javax.net.ssl.SSLHandshakeException occurs
[Java] Precautions when comparing character strings with character strings
Create Java applications with IBM Cloud Functions