# Export application with json file fail

**URL:** <https://discourse.processing.org/t/export-application-with-json-file-fail/11637>\
**Category:** Processing\
**Created:** [May 27, 2019, 5:22pm UTC](https://discourse.processing.org/t/export-application-with-json-file-fail/11637 "2019-05-27T17:22:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![skovholm](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@skovholm](https://discourse.processing.org/u/skovholm)\
**Post date:** [May 27, 2019, 5:22pm UTC](https://discourse.processing.org/t/export-application-with-json-file-fail/11637/1 "2019-05-27T17:22:33Z")

</div>

hi i do a simple project .  
works fine when i push play in processing 3.0  
when i do push EXPORT application and make windows and embed java i get the files exported.  
But when trying to rin the exe file …it show the window but no text …  
**How to export application when using a json file in the project ?**

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* the pde file

```auto
JSONObject json;

void setup() {

  json = loadJSONObject("data.json");

  int id = json.getInt("id");
  String species = json.getString("species");
  String name = json.getString("name");
  textSize(12);
  text(id, 10, 10); 
  text(species, 10, 20);
  text(name, 10, 30);
}

```

\*\*\*\*\*\*\*\*\*\*\*\* the json file

```auto
{
   "id": 0,
  "species": "Panthera leo",
   "name": "Lion"
}

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [May 27, 2019, 7:03pm UTC](https://discourse.processing.org/t/export-application-with-json-file-fail/11637/2 "2019-05-27T19:03:35Z")

</div>

interesting

maybe because there is no draw() and you don’t do the text in draw()?

---

<div class="post-metadata">

**Author:** ![skovholm](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@skovholm](https://discourse.processing.org/u/skovholm)\
**Post date:** [May 27, 2019, 7:34pm UTC](https://discourse.processing.org/t/export-application-with-json-file-fail/11637/3 "2019-05-27T19:34:48Z")

</div>

hi

no it is the same …the problem is the json file

```auto
JSONObject json;

int id;
String species;
String name;

void setup() {

  json = loadJSONObject("data.json");

  id = json.getInt("id");
  species = json.getString("species");
  name = json.getString("name");
 
}

void draw(){
  textSize(12);
  text(id, 10, 10); 
  text(species, 10, 20);
  text(name, 10, 30);
}

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [May 27, 2019, 7:36pm UTC](https://discourse.processing.org/t/export-application-with-json-file-fail/11637/4 "2019-05-27T19:36:46Z")

</div>

is the json file included in the export files?

is it in the data folder?

try

```auto
void setup() {
    size(600,600); 
    json = loadJSONObject(“data.json”);
    ....

```

---

<div class="post-metadata">

**Author:** ![skovholm](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@skovholm](https://discourse.processing.org/u/skovholm)\
**Post date:** [May 27, 2019, 8:26pm UTC](https://discourse.processing.org/t/export-application-with-json-file-fail/11637/5 "2019-05-27T20:26:19Z")

</div>

THANKS …  
I did not create a datafolder …when i do and put the file there …NO PROBLEM …

THANKS ;o)

![Udklip](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/70d22eb033b9629e484cb8b4fb29b677f92c55f5.jpeg)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [May 31, 2019, 5:33pm UTC](https://discourse.processing.org/t/export-application-with-json-file-fail/11637/6 "2019-05-31T17:33:20Z")

</div>

Quote:

In a program that has the **setup()** function, the **size()** function **MUST** be the first line of code inside **setup()** , and the **setup()** function must appear in the code tab with the same name as your sketch folder. [https://processing.org/reference/size\_.html](https://processing.org/reference/size_.html)
