kotlin-compiler-server icon indicating copy to clipboard operation
kotlin-compiler-server copied to clipboard

Running Kotlin server locally does not return output in text field

Open Zordid opened this issue 3 years ago • 2 comments

I simply clone this repo, compile & run it locally on localhost:8080.

When sending the same request as on your documentation page:

curl -X POST \
  http://localhost:8080/api/compiler/run \
  -H 'Content-Type: application/json' \
  -d '{
    "args": "1 2 3",
    "files": [
        {
            "name": "File.kt",
            "text": "fun main(args: Array<String>) {\n    println(\"123\")\n}"
        }
    ]
}'

The result does not contain the STDOUT which should be printed on the console. It just returns this: {"errors":{"File.kt":[{"interval":{"start":{"line":0,"ch":9},"end":{"line":0,"ch":13}},"message":"Parameter 'args' is never used","severity":"WARNING","className":"WARNING"}]},"exception":null,"text":""}

The log of the Spring application does not show any errors.

Can somebody help?

Zordid avatar Nov 12 '21 09:11 Zordid

Import add-on: this happens on my Mac. I just tried on an Ubuntu Linux where it works fine. Why is there a difference ONLY in the text returned which should contain the STDOUT?

Zordid avatar Nov 12 '21 12:11 Zordid

Hi, sorry, I missed the issue =( I think the problem is due to java security policy. If you commented line it will work as expected.

btw it works on my osx

AlexanderPrendota avatar Jan 03 '22 20:01 AlexanderPrendota