This tutorial is a complete guide for setting up DynamoDB database on Ubuntu 16.04 locally. The tutorial is tested on Ubuntu 16.04 with completely working commands.
Prerequisites
JAVA
DynamoDB requires java for working.DynamoDB supports the Java Runtime Engine (JRE) version 6.x or newer; it does not run on older JRE versions.
Run the following commands to install Java JRE 7
# Open terminal & give following commands
sudo apt-get install openjdk-7-jre-headless
sudo apt-get install openjdk-7-jdk

#IF YOU ARE GETTING PROBLEM TO INSTALL JRE/JDK 7 then use following commands(Optional)
sudo apt-get install -f
sudo add-apt-repository ppa:openjdk-r/ppa  
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless
sudo apt-get install openjdk-7-jdk

To check which java version is install on system.
# Open terminal & give following commands
java -version

DynamoDB Local ( Downloadable Version )
Download the Amazon Dynamo Database Downloadable Version using following links:
1) .tar.gz formathttp://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz
2) .zip format: http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.zip
After Downloading the Dynamo Database Extract it in Home Folder
Running DynamoDB Locally on Ubuntu
# Open terminal & give following commands
# Change directory
cd dynamodb_local_latest
java -jar DynamoDBLocal.jar

That's it, DynamoDB is running Locally on your machine.
# Open the shell to show it's working!
open http://localhost:8000/shell