Where has json.org java library gone?

So, I'm trying to learn JSON, for Java, but it appears to be a moving target - there are a number of libraries available, but I prefer to stick to either the JSON.ORG version or the Oracle Java javax version. However, it seems that JSON.ORG no longer provides docs or an 'official' library. None of the .org links I have found - apart from the landing page - work any longer. Eg http://www.json.org/java

The end result is that much of what I find and learn I can't apply because they reference the JSON.ORG library which does not seem to be available any longer.

The landing page does provide a list of other libraries that can be used. One of these is generically named: JSON-lib on sourceforge. Is this the one that used to be on JSON.ORG? There's no reference that says that.

Am I missing something? Is the JSON.ORG library available elsewhere, or shuld I just stick with Oracle's javax.json? Or, is Google's version a better option?


I'm trying to learn JSON

What is there to learn about JSON? There are objects, arrays, and values...

I prefer to stick to either the JSON.ORG version or the Oracle Java javax version.

Once you understand the structure of JSON, why does preference matter unless you are trying to maintain legacy code?

Libraries become deprecated and developers often no longer maintain their projects when something else such as Gson or Jackson come along that outshine them. As long as you are familiar with the general concept of parsing JSON, library usage is a heavily opinionated answer.

As you've discovered, the JSON.org library is non-existent, but at least there are a long list of alternatives.

Gson and Jackson are the popular ones simply for their object marshaling capabilities as well as exception handling (such as getting a value from a JSONObject for a key that doesn't exist).

If you just want a simple, minimal JSON parsing library, then either javax.json or json-simple are fine.


I have used them all on a variety of projects, but I am offering my unbiased opinion that you should just pick a library and hope it stays around and is maintained by its developers.


The org.json library originally written by Douglas Crockford is alive and well, and can be found here: https://github.com/stleary/JSON-java

Jar files are available from the Maven repository: https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.json%22%20AND%20a%3A%22json%22

链接地址: http://www.djcxy.com/p/32172.html

上一篇: Python中的矩阵求幂

下一篇: json.org java库去哪了?