• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help for building org.json.me jar

 
Jhon Barrantes
Greenhorn
Posts: 17
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to use json in my Java ME project. I have found a few tutorials that look promising , but I haven't been able to find the jar that is used in those tutorials.

This is of link I found with the source code:


https://bitbucket.org/liedman/json-me



I tried to generate the jar using the source code downloaded from those links, I've even installed Maven , but all I get is errors like this :



Can anyone help me to make a jar file out of this. I confess that I'm really new to Java, therefore, I am asking for help.

Please I really need to use this jar because I've realized it is the easiest way to work with json in j2me. I really appreciate if you could help me finally get this jar.

Thanks in advance.

 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems hat Maven is not installed or configured correctly, but let's take a step back: why do you need Maven in the first place? You do not need a jar file of those classes, after all (although that is easy enough to create using "javac" and "jar") - you can just add those source files to your application, and compile them along with all your other classes, no?
 
Jhon Barrantes
Greenhorn
Posts: 17
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:It seems hat Maven is not installed or configured correctly, but let's take a step back: why do you need Maven in the first place? You do not need a jar file of those classes, after all (although that is easy enough to create using "javac" and "jar") - you can just add those source files to your application, and compile them along with all your other classes, no?

Everybody says it is easy, but I haven't be able to do anything with those commands that's why ended up using Maven.
It is really frustrating , being stuck just because you don't have that jar everyone says it's so easy to generate but nobody tells you how to do it.

This is the the path to the classes



In all the tutorials I've seen they use something like this :

import org.json.me.JSONException;
import org.json.me.JSONObject;

So I guess I have to start at the org folder, right?? Please if it is so easy , would you be so kind as to guide me through the process ??? Please!!

 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Open a command line window in the "src" directory. 2) type "javac org/json/me/*.java" 3) type "jar cf json-me.jar org".
4) There is no step 4 - you're done.

This assumes that during the installation of the JDK, the JDK tools directory was added to the PATH environment variable, but that should have happened.
 
Jhon Barrantes
Greenhorn
Posts: 17
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ulf Dittmer you're a life-saver!!!
Now I really know how to build jars from source code.

P.S. I also found the original jar I was looking for. Here's the link in case anyone needs it. http://www.java2s.com/Code/Jar/j/Downloadjsonmejar.htm

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic