You need to create a maven project for this where its structure might look like this
my-app|-- pom.xml`-- src |-- main | `-- java | `-- com | `-- ibm | `-- watson | `-- speech_to_text | `-- Main.java
src, main, java, com, ibm, watson, speech_to_text are the directories.
The content of the pom.xml
might look like
<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/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.ibm.watson</groupId><artifactId>my-app</artifactId><version>1.0-SNAPSHOT</version><dependencies><dependency><groupId>com.ibm.watson</groupId><artifactId>ibm-watson</artifactId><version>9.2.0</version></dependency></dependencies></project>
This includes your dependencies,
After this, you need to have maven installed in your machine to compile and run it. After installing maven you can run
mvn clean install OR mvn package
to compile/build the project. This will create a JAR file for you.
Finally, you can run the project with
java YOUR_JAR_NAME.jar
Suggestions:
Don't use the package com.ibm.watson.speech_to_text
in your java file instead use your own e.g. com.mycompany.app
so your directory structure will also change as per the package name i.e.
my-app|-- pom.xml`-- src |-- main | `-- java | `-- com | `-- mycompany | `-- app | `-- Main.java
pom.xml
content will also change according to this
<groupId>com.mycompany.app</groupId>