studyro
studyro

Reputation: 161

Cannot run the project in Eclipse on Mac

Exception occurred executing command line.
Cannot run program "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java" 
(in directory  "/Users/zhangstudyro/Developer/Java/HiWorld"): error=2, No such file or directory

Hi, I'm new to mac.

The report above is the problem details given by eclipse when I tried to run "HiWorld".

I can "javac" and "java" the code in Terminal. And in eclipse, I've added JDK1.6.0 which is the default JDK version to the Build Path Libraries.

Googled and SOFed for hours, but I'm still perplexed with my Eclipse on Mac.

Upvotes: 2

Views: 4511

Answers (1)

toadzky
toadzky

Reputation: 3846

I had the same issue with Intellij. I fixed it by changing the path to the JDK.

For me, the issue was cause by Apple changing the JDK's location when my work computer got upgraded to the latest version of Mac OS X. The new path for my JDk looks the same, but doesn't start with "/System".

Upvotes: 3

Related Questions