Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scratch file not running on IntelliJ IDEA

I am trying to run a Kotlin scratch file in IntelliJ just like you would run a Java scratch file, but it doesn't work.

I created a new Kotlin scratch file, but can't run the code even after attempting the following:

  • Create a main function and print something inside.
  • Print something with println outside of the main function.
  • Create a class with a main function inside and println something.

When I create a new kotlin project, the project runs fine. The issue happens only with scratch files. I am using kotlin plugin version 1.1.51 on IntelliJ 2017.1

As the screenshot shows, the icon that allows you to run kotlin code doesn't show up on the left of the editor window:

enter image description here

like image 440
spuente Avatar asked Oct 01 '17 18:10

spuente


People also ask

How do I run a scratch file in IntelliJ?

From the main menu, select File | New | Scratch File or press Ctrl+Alt+Shift+Insert . Select the language of the scratch file. Scratch files of the same type are automatically numbered and added to the Scratches and Consoles directory of the Project view. in the gutter or press Shift+F10 .

What is the file extension of a scratch project?

Scratch 2.0 uses the *. sb2 file format. These are zip files containing a . json file as well as the contents of the Scratch project including sounds (stored as .

What is a scratch buffer?

scratchBuffer. A buffer used to hold data while building the acceleration structure. scratchBufferOffset. An offset, in, bytes, in the scratch buffer where the scratch memory starts.


1 Answers

Your observations are correct, and this is a known issue.

like image 104
zsmb13 Avatar answered Sep 18 '22 12:09

zsmb13