localOS java,在Mac OS X上使用java命令运行DynamoDB Local

I'm trying to run DynamoDB local on a MAC.

The Amazon official blog says I have to download the jar file and run the following command:

$ java –Djava.library.path=. -jar DynamoDBLocal.jar

But I got the following error on MAC OS X terminal:

Error: Could not find or load main class –Djava.library.path=.

Wut? The command seams not to recognise the -D parameter.. why?

I'm also working on Linux (Fedora) and I never had any problem with it.

On MAC OS X, java -version gives me java version "1.8.0_11"

What could be the problem? (I don't know that much with java commands)

Edit 1: Thanks to @Swapnil, we can notice that there is a typo error on the Amazon blog, they used a wrong dash character (EN DASH unicode U+2013) for the -D argument. Note that the Amazon documentation (not the blog) does not have the typo error and also refers to an up-to-date binary.

Edit 2: With the correct dash, the argument is interpreted by java, but I still got a (different) error message during runtime:

SEVERE: [sqlite] SQLiteQueue[AKID_eu-west-1.db]: error running job

queue com.almworks.sqlite4java.SQLiteException: [-91] cannot load

library: java.lang.UnsatisfiedLinkError: no sqlite4java-osx-x86_64 in

java.library.path

I fixed it like that:

java -Djava.library.path=./DynamoDBLocal_lib/ -jar DynamoDBLocal.jar

It's now finally working... Amazon documentation have some problems..

解决方案

The below seems to work for me on my Mac OS X -

java -Djava.library.path=. -jar your_jar

Well, the dash character you've used in –D seems to be a different character altogether. That's probably causing the problem.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值