Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS Intellij Error while running scala program

I am new to Intellij and Scala. I just now installed Intellij and while creating first project of hello world I get the following error when I compile Scala code on Intellij.

Error:

Cannot run program "/Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home/bin/java" (in directory "/Users/rahulghadge/Library/Caches/IdeaIC2017.3/compile-server"): error=2, No such file or directory

I tried to google it and check in my contacts if someone faced it before. Nothing helped. Please advise.

like image 557
Rahul Ghadge Avatar asked Mar 31 '26 21:03

Rahul Ghadge


1 Answers

I figured out it is scala and jdk version compatibility issue. I had jdk_1.8.0_121.jdk but i had to install jdk_1.8.0_161.jdk on my mac. Once this was done, I added it in Intellij File -> Project Structure -> SDKs. And above mentioned compile error was resolved.

I found out below mentioned link particularly useful as it discusses about same error but solution is different version of jdk to be installed as per Scala version in use. Please refer that for step-by-step guide with screenshots for more details.

https://dotnetvibes.com/2018/01/03/intellij-idea-error-cannot-run-program-no-such-file-or-directory/

Thanks.

like image 69
Rahul Ghadge Avatar answered Apr 02 '26 12:04

Rahul Ghadge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!