# Export sketch (using G4P) successful, but app run fails

**URL:** <https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345>\
**Category:** Libraries\
**Created:** [April 24, 2024, 1:42pm UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345 "2024-04-24T13:42:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Marcel](https://discourse.processing.org/u/Marcel)\
**Post date:** [April 24, 2024, 1:42pm UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345/1 "2024-04-24T13:42:24Z")

</div>

Hey There,

I did searched for any similar problems on the forum but unlucky to find anything that could help me further.

I’ve created a sketch, using G4P, exported the file successfully  
( Processing feedback window :  
Compiling resources  
Linking  
Successfully created C:.…\windows-amd64\UT\_Machine\_Control.exe  
)

and tried to run the “.exe”. When double clicking the “.exe” nothing happens. On some machines I see the processing startup splash screen in a flash, other machines just a windows loading animation for a split second and then nothing.  
No processes visible running in task manager.

Some info:  
W11 Machine:  
Processing 4.0b8  
G4P tool 4.4.2.

W10 Machine:  
Processing 4.3  
G4P Tool 4.4.2

I’ve create a small sketch (not using G4P) to test the machines and on both W10 & W11 they work. The export is created on the W10 machine with administrator rights including the JAVA dir.

If somebody has any idea’s or pointers, greatly appreciated.  
what information do you need to be able to give some advise?

Tried to make a basic sketch with G4P (no contrils) and can make and run the exe.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [April 24, 2024, 3:13pm UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345/2 "2024-04-24T15:13:41Z")

</div>

> [@Marcel](#):
>
> G4P tool 4.4.2.

To avoid confusion with the G4P library this tool is called _ **G4P GUI Builder** _ or more simply _ **GUI Builder** _. I will use the latter.

GUI Builder is only used during sketch creation so is _completely ignored_ when the sketch is executed. GUI Builder also creates a second tab called `gui.pde` which is exported with the application 👍. It also creates a folder called `GUI\_BUILDER\_DATA which is also exported but will not be accessed by the app.

Now I have an iMac desktop and W10 laptop so I can’t reproduce your tests but I created a Processing sketch using GUI Builder that had a G4P button and G4P label. On each machine I was able to export the sketch and run the application. Processing on Windows does not support exporting for mac but I did create a Windows export on my iMac but it failed due to a JNI error.

Sorry this doesn’t help much but it seems to me that the problem is not related to **GUI Builder** or **G4P**.

---

<div class="post-metadata">

**Author:** ![Marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Marcel](https://discourse.processing.org/u/Marcel)\
**Post date:** [April 24, 2024, 3:34pm UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345/3 "2024-04-24T15:34:43Z")

</div>

Hi quark,

Thanks for replying. I think you’re absolutely right. I’m not blaming the awesome G4P builder tool what so ever. Been using it extensively with joy and result. Just trying to trace my errors.  
It’s probably my programming skills that somehow mess up the program when exported. The sketch works perfect while running in the processing environment. Just was hoping that someone experience the same challenge.  
Is there a way of tracing the fault? Yes I could gradually build the program from scratch and see where I mess up. But that’s quite a labor and time expensive undertaking.

I’ll think about it and probably will comeback on this issue. 🙂

Cheers

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [April 24, 2024, 5:31pm UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345/4 "2024-04-24T17:31:31Z")

</div>

> [@Marcel](#):
>
> I’m not blaming the awesome G4P builder tool

I didn’t think that you were. My response wasn’t meant to appear defensive as I am more than happy to accept responsibility for bugs in my code 😄 I was just trying to rule out the possibility so you could focus on more likely areas,

> [@Marcel](#):
>
> Is there a way of tracing the fault?

It seems to me that the issue is related to the Java VM since you get a window but it shuts down immediately.

You might check the versions of Java (JRE not JDK) installed on the machines. I suspect there must be some Windows error log files but I am not knowledgeable in this area. Hope someone else can offer more informed advoce.

---

<div class="post-metadata">

**Author:** ![Marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Marcel](https://discourse.processing.org/u/Marcel)\
**Post date:** [April 26, 2024, 7:35am UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345/5 "2024-04-26T07:35:19Z")

</div>

Hi quark,

I think I’ve found the problem. Hopefully you can point me in the right direction. I hope you can remember that I’ve created a new class called: “GEncoderKnob”. If I comment out all related code the export works fine. Like I said in my earlier comments : “It’s probably my programming skills that somehow mess up the program when exported”. This might be the case here ☹

A small test program I’ve created, of which the code I’ve shared (in a different post) works under processing IDE but I can’t get it working in an export. Is there a way you can try if you can export the test code and see if you encounter the same issues I’m having?

Any help as usual greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Marcel](https://discourse.processing.org/u/Marcel)\
**Post date:** [April 26, 2024, 7:42am UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345/6 "2024-04-26T07:42:04Z")

</div>

this [post : [G4P Create new Control-class to use in Sketch](https://discourse.processing.org/t/g4p-create-new-control-class-to-use-in-sketch/44047)

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [April 26, 2024, 5:53pm UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345/7 "2024-04-26T17:53:27Z")

</div>

I have been doing some experiments and although the export application works with G4P it does not work with your GEncoderKnob class which extends the GKnob class in G4P.

I believe that I understand what is happening but any _potential_ solution requires source code changes in the G4P library code and therefore a new release.

I say ‘potential’ because I need to do some more testing. Also although I suspect the changes needed are very simple I will not be rushing out a new version because there are other issues waiting to be resolved for the next release.

I will keep you posted. 😄

---

<div class="post-metadata">

**Author:** ![Marcel](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Marcel](https://discourse.processing.org/u/Marcel)\
**Post date:** [April 26, 2024, 8:25pm UTC](https://discourse.processing.org/t/export-sketch-using-g4p-successful-but-app-run-fails/44345/8 "2024-04-26T20:25:51Z")

</div>

Thanks quark,

No rush. Like I said any help is appreciated.

Cheers
