添加JSON包引用;新到Java [英] Add JSON Package Reference; new to Java
问题描述
这三个导入无法解决:
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
我去了json.org和下载了Java库,但我不知道该怎么做。我试图进入项目属性并添加一个外部类无效。我注意到下载的文件夹是.java文件。我应该怎么做这些?
对不起,在这里提出这样一个noob问题,但我被困了。
这是一个错误的下载我相信。您需要此处的JSON-Simple库,请 http://code.google.com/p/json-简单/ 。您的链接指向另一个实现。
下载后,* .jar应该添加到类路径中。你如何做这取决于你使用的工具。在Eclipse中,右键单击项目Properties-> Libraries并添加新的JAR。
I'm brand new to Java and have always been a c kind-of-guy. That being said, I'm trying to use the JSON libraries (packages? classes? Java terminology is so damn confusing!) and am having issues adding them as a reference.
These three imports cannot be resolved:
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
I went to json.org and downloaded the Java libraries but I'm not sure what to do with them. I've tried to go into project properties and add an external class to no avail. I noticed the downloaded folder is full of .java files. What am I supposed to do with these?
Sorry to present such a noob question on here, but I'm stumped.
This is a wrong download I believe. You need JSON-Simple library from here http://code.google.com/p/json-simple/ . Your link points to another implementation.
After download the *.jar should be added to the classpath. How you do it depends on the tools you use. In Eclipse it is right-click on the project, Properties->Libraries and add the new JAR.
这篇关于添加JSON包引用;新到Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!