I have a java program that I use Gradle to build. In this program I use the JSON jar "org.json:json:2014113" this program compiles and works just fine when I run it in my IDE (IntelliJ 14) It also compiles and runs just fine when I run the jar, except for when the function that I use the JSON in is called, I then get a Java.lang.NoClassDefFoundError: org/json/JSONArray
error here is my build.gradle script
version 'UR'
apply plugin: 'java'
sourceCompatibility = 8
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.json', name: 'json', version: '20141113'
}
jar {
destinationDir = file("C:\\Users\\Jonah\\Documents\\Software\\RapIDE Builds")
manifest {
attributes 'Main-Class': 'frames.MainFrame'
}
}
and here is my JSON class
package logic;
import frames.MainFrame;
import org.json.JSONArray;
import org.json.JSONObject;
public class JSONparser extends MainFrame
{
public static String SLrtrn;
public static void parseJSON(String JSONinput)
{
final JSONArray JSONrtrn = new JSONArray(JSONinput);
rhymeList.removeAllElements();
for (int i = 0; i < JSONrtrn.length(); ++i)
{
JSONObject parsedObj = (JSONObject) JSONrtrn.get(i);
SLrtrn = parsedObj.get("word").toString();
rhymeList.addElement(SLrtrn);
}
}
}
Am I doing something wrong in the build.gradle script?