Error starting Java application

The magazine shows it

"error=2, No such file or directory" "Cannot run program /Applications/IntelliJ IDEA.app/Contents/jre/jdk/Contents/Home/bin/java" (in directory "/Users/.. " and a path to a directory that exists. 

I could replicate the error when starting the hello world application without any dependencies and configurations (without maven, no spring).

I am using Intellij 2016 and OSX El Capitan

+5
source share
1 answer

The problem was in the SDK, which referenced the one that was linked inside Intellij.

I could solve this by modifying sdk and referencing it outside of Intellij. This can be done by choosing File> Project Structure> SDK , and in the "JDK Start Path" enter the path to the SDK (in my case /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home ).

+13
source

All Articles