# Could not run the sketch

**URL:** <https://discourse.processing.org/t/could-not-run-the-sketch/11040>\
**Category:** Processing\
**Created:** [May 8, 2019, 4:13pm UTC](https://discourse.processing.org/t/could-not-run-the-sketch/11040 "2019-05-08T16:13:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DerekCresswell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/derekcresswell/32/4868_2.png) [@DerekCresswell](https://discourse.processing.org/u/DerekCresswell)\
**Post date:** [May 8, 2019, 4:13pm UTC](https://discourse.processing.org/t/could-not-run-the-sketch/11040/1 "2019-05-08T16:13:32Z")

</div>

Could not run the sketch.

Usage: PApplet [options] [sketch args]  
See the Javadoc for PApplet for an explanation.  
Could not run the sketch (Target VM failed to initialize).  
For more information, read revisions.txt and Help ? Troubleshooting.

My code shouldn’t have any errors and I opened a blank sketch and it ran fine. What’s up? Through my bit of testing it seems to work fine when I comment out the main() in my class. More testing, so can I not have a function called main?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [May 8, 2019, 4:47pm UTC](https://discourse.processing.org/t/could-not-run-the-sketch/11040/2 "2019-05-08T16:47:54Z")

</div>

> [@DerekCresswell](#):
>
> , so can I not have a function called **main()**?

Short answer is no. Theoretically we can, but w/ consequences. 😨  
Notice that a “.pde” file is almost, but not as the same thing as a “.java” file. ☕

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [May 8, 2019, 5:12pm UTC](https://discourse.processing.org/t/could-not-run-the-sketch/11040/3 "2019-05-08T17:12:56Z")

</div>

This [post](https://happycoding.io/tutorials/java/processing-in-java) explains how a simple pde sketch is secretly transformed into the standard Java code by the PDE(Processing Development Environment). I hope this clarifies why you cannot have a `main()` in your sketch unless you take certain steps.

Kf

---

<div class="post-metadata">

**Author:** ![DerekCresswell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/derekcresswell/32/4868_2.png) [@DerekCresswell](https://discourse.processing.org/u/DerekCresswell)\
**Post date:** [May 8, 2019, 6:51pm UTC](https://discourse.processing.org/t/could-not-run-the-sketch/11040/4 "2019-05-08T18:51:02Z")

</div>

@kfrajer @GoToLoop Ok thanks
