Configure IntelliJ to compile Java files in a non-Java project

Answered

I have a catch all git repo that has code snippets from many technologies.  Javascript, Java, SpringBoot, Groovy, PHP, CSS, Bash, WSH.

One of the directories contains a java file I'd like to compile and run.

Is this possible?  As a work around, I copied the file to a Java maven project and compiled and ran it there.

I'm using IntelliJ Ultimate 2021.2.4

2 comments
Comment actions Permalink

Just mark the parent folder of .java file as sources and set Java SDK for the module. 

1
Comment actions Permalink

Thanks Konstantin, it worked perfectly!  

0

Please sign in to leave a comment.