Processing in Kotlin with static main function error

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 :crazy_face:
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:

the whole pde like this:

class Main3 : PApplet() {

    override fun settings() {

    override fun setup() {


    override fun draw() {

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


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】


Welcome to the community! :wink:

Maybe this previous thread on the subject might be useful :

1 Like