How to setup DynamoDB Locally on Mac

SatheeshAlexaLeave a Comment

Step 1 : Install Java When you try to setup DynamoDB on Mac, you will need to have Java Installed. If you just go to Java website by Oracle and install, still you may get error on command line tools like below.

“To use the java command-line tool, you need to install a JDK.” It asks you to click “More Info” and visit the JDK (Java Developer Kit) download website.

The problem is that you will be redirected to wrong JDK page. You should go to this page and install

https://support.apple.com/kb/dl1572?locale=en_US

Step 2 : Download DynamoDB :  The full setup guide is here : https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html , which has links to download the software.

Step 3 : When you try to follow the guide on AWS and type “java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb”, you will get below error.

Port: 8000
InMemory: false
DbPath: null
SharedDb: true
shouldDelayTransientStatuses: false
CorsParams: *

Exception in thread “main” java.lang.UnsupportedClassVersionError: org/apache/logging/log4j/spi/ExtendedLogger : Unsupported major.minor version 51.0

at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.amazonaws.services.dynamodbv2.local.shared.logging.LogManager.<clinit>(LogManager.java:28)
at com.amazonaws.services.dynamodbv2.local.server.DynamoDBProxyServer.<clinit>(DynamoDBProxyServer.java:36)
at com.amazonaws.services.dynamodbv2.local.main.ServerRunner.createServer(ServerRunner.java:124)
at com.amazonaws.services.dynamodbv2.local.main.ServerRunner.createServerFromCommandLineArgs(ServerRunner.java:120)
at com.amazonaws.services.dynamodbv2.local.main.ServerRunner.main(ServerRunner.java:71)

Check your Java Version by typing Java – version , it would be 1.6 like below

To fix this error, you will need to download the latest JDK version from Java’s official website.

After you install the software, you should see the Java version updated to 1.8 like below when you type in Java – version

Now if you run the command to start DynamoDB, it should work and you should see something like below.

As mentioned in the guide by Amazon, DynamoDB processes incoming requests until you stop it. To stop DynamoDB, type Ctrl+C at the command prompt.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.