添加JSON包引用;新到Java [英] Add JSON Package Reference; new to Java

查看:503
本文介绍了添加JSON包引用;新到Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Java非常全新,而且一直是一个很好的人。话虽如此,我试图使用JSON库(软件包?类?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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆