Coder Social home page Coder Social logo

starter-java's Introduction

Welcome to the Java Guild!

As members of the Java Guild, you will be working through the challenges of TwilioQuest using the Java programming language and the Spark Framework. This project is pre-configured to have some interesting functionality built in using the Twilio Java helper library.

Setting Up

As a first step, you should download this project, or clone it if you are a Git user. Navigate to the directory for this project, and open it with your favorite text editor.

Before you can run this project, you will need to set three system environment variables. These are:

  • TWILIO_ACCOUNT_SID : Your Twilio "account SID" - it's like your username for the Twilio API. This and the auth token (below) can be found on the console.
  • TWILIO_AUTH_TOKEN : Your Twilio "auth token" - it's your password for the Twilio API. This and the account SID (above) can be found on the console.
  • TWILIO_PHONE_NUMBER : A Twilio number that you own, that can be used for making calls and sending messages. You can find a list of phone numbers you control (and buy another one, if necessary) in the account portal.

For Mac and Linux, environment variables can be set by opening a terminal window and typing the following three commands - replace all the characters after the = with values from your Twilio account:

export TWILIO_ACCOUNT_SID=ACXXXXXXXXX
export TWILIO_AUTH_TOKEN=XXXXXXXXX
export TWILIO_PHONE_NUMBER=+16518675309

To make these changes persist for every new terminal (on OS X), you can edit the file ~/.bash_profile to contain the three commands above. This will set these environment variables for every subsequent session. Once you have edited the file to contain these commands, run source ~/.bash_profile in the terminal to set up these variables.

On Windows, the easiest way to set permanent environment variables (as of Windows 8) is using the setx command. Note that there is no =, just the key and value separated by a space:

setx TWILIO_ACCOUNT_SID ACXXXXXXXXX
setx TWILIO_AUTH_TOKEN XXXXXXXXX
setx TWILIO_PHONE_NUMBER +16518675309

Running the Application

Now that our project is ready, we need to build it using maven:

mvn clean install

Start the application:

java -jar target/starter-java-with-dependencies.jar 

Now you can visit http://localhost:4567/

Try out the text message and voice call demos by entering your mobile phone number and clicking the button. If you receive a text message and a call, everything is working!

Begin Questing!

This is but your first step into a larger world. Return to TwilioQuest to continue your adventure. Huzzah!

starter-java's People

Contributors

dprothero avatar kwhinnery avatar maylonpedroso avatar smendes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starter-java's Issues

The requested route [/hello] has not been mapped in Spark for Accept

In trying to finish one of the tasks in the first training module (Basic Training), I'm getting this error message:

[qtp1069318286-36] INFO spark.http.matching.MatcherFilter - The requested route [/hello] has not been mapped in Spark for Accept: [text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9]

The task is: Enter a URL for the "/hello" TwiML route on localhost:

My browser isn't recognizing literally "http://localhost:4567/hello". Yes, i could just enter this into the task and it passes. But why isn't it working in real life?

Unable to run on my Windows 10 Pro machine

Just joined the Guild today. I have a beginner's level of coding experience.

The following is from my terminal through VSCode.

PS C:\Users\13146\starter-java> java -jar target/starter-java-with-dependencies.jar 
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
PS C:\Users\13146\starter-java> 

I have Jave 8, 11, 13, and 14 on my machine. I just did a "set path" to the 1.8 LTS bin directory, and it did not change the result.

Suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.