Reputation: 131
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.
Upvotes: 3
Views: 1366
Reputation: 131
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.
Upvotes: 2