简体   繁体   中英

Import json-simple from Maven failed

I'm practicing Java JSON programming using JSON-Simple on this site which says:

All the jars available in maven repo is supported.

UPDATE:

So I've now added the external maven library to project.

在此处输入图片说明

But I still can't get it work.

I tried

import com.googlecode.json-simple.JSONObject;

but got:

error: ';' expected
import com.googlecode.json-simple.JSONObject;
                          ^

Then I tried

import com.googlecode.json_simple.JSONObject;

but got:

error: package com.googlecode.json_simple.parser does not exist
import com.googlecode.json_simple.parser.JSONParser;
                                        ^

How to make it works?

I'm pretty sure you forgot to add external maven library to project. Check this out: 在此处输入图片说明

...and enter: org.apache.clerezza.ext:org.json.simple:0.4

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM