# Processing in Kotlin with static main function error

**URL:** https://discourse.processing.org/t/processing-in-kotlin-with-static-main-function-error/29039
**Category:** Coding Questions
**Created:** [April 1, 2021, 3:09am UTC](https://discourse.processing.org/t/processing-in-kotlin-with-static-main-function-error/29039 "2021-04-01T03:09:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sharpeye](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@sharpeye](https://discourse.processing.org/u/sharpeye)
#### Post date: [April 1, 2021, 3:09am UTC](https://discourse.processing.org/t/processing-in-kotlin-with-static-main-function-error/29039/1 "2021-04-01T03:09:06Z")

</div>

Hi ,I’m a Processing learners from China，and I am experimenting with writing prcoessing cod in Kotlin environment。But some problems that are pressing on me，like this one 🤪  
I want to code the pde Imitate the standard Java style, like put the entry function(main) into the PApplet class,not separate from it , and then run the program.but some error like this:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6c1edcc691bf13a0cf332a1f07fe4e4e72337622.png)  
the whole pde like this:

```auto
class Main3 : PApplet() {

    override fun settings() {
        size(500,400)
    }

    override fun setup() {

    }

    override fun draw() {
    }

    companion object {
        @JvmStatic
        fun main(passedArgs: Array<String>) {
           // val appletArgs = arrayOf("Main3")
            //PApplet.main(appletArgs)
        }
    }

}

```

so is there any solution?please help me，thank you very much ~ . 【well,emmm…I’m sorry to discuss it with you in poor English,I will keep practice】

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [April 1, 2021, 7:21am UTC](https://discourse.processing.org/t/processing-in-kotlin-with-static-main-function-error/29039/2 "2021-04-01T07:21:20Z")

</div>

Hi,

Welcome to the community! 😉

Maybe this previous thread on the subject might be useful :

> [@Writing Processing in Kotlin](https://discourse.processing.org/t/writing-processing-in-kotlin/3957):
>
> Hi there, I just tried running a Processing program written in the [Kotlin language](https://kotlinlang.org/), and I thought I would share here the steps in case anyone wants to try. This may not be very interesting if you are happy using the Processing IDE and your projects don’t grow very large. I wonder how many users in this forum use other editors like IntelliJ Idea… If you already do then you might be curious about trying this: Install IntelliJ Idea community edition (free), Processing and Kotlin. Create a new Ko…
