Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

This file in the editor in not runnable intelliJ idea using java

I installed intelliJ idea for the first time to code in java, before this IDE I used VS Code for the development and compilation. After installing I opened previously written code folders in IntelliJ which has the run button in grey showing "this file in the editor is not runnable".

this is the directory structure with the code

Previously in VS Code these files were easily compiled but in IntelliJ idea I have no clue why it is happening.

like image 322
G raj Kumar Avatar asked Dec 07 '25 06:12

G raj Kumar


1 Answers

You could right-click the "Sorting" folder, and choose Mark Directory as | Sources Root. Then you should be able to run that Java code. In IntelliJ IDEA, the folder including all Java packages should be marked as a source root to make it work. See here for details: https://www.jetbrains.com/help/idea/content-roots.html

like image 159
LJ replica Avatar answered Dec 09 '25 19:12

LJ replica