A.Jac
A.Jac

Reputation: 1673

Intellij error=2 No such file or directory

Installed intellij and added sdk path to project structure, but when i try to run i get:

Error: Cannot run program "/home/$USER/java/jdk1.8.0_121/bin/java" 
(in directory"/home/$USER/.intelliJIdea2016.3/system/compile-server"):
error=2, No such file or directory

Both files (/home/$USER/java/jdk1.8.0_121/bin/java and /home/$USER/.intelliJIdea2016.3/system/compile-server) exists.

I am using Ubuntu 16.10

Upvotes: 25

Views: 40251

Answers (5)

aldinsab
aldinsab

Reputation: 1

Did you try doing a Maven Reload? I had the same issue, and i tried everything, nothing worked, the only thing that worked, was reloading Maven, it fixed the problem. I hope it helps.

Upvotes: 0

Enison Oliveira
Enison Oliveira

Reputation: 1

1-see your version system, is window, mac or linux?

2-dowload specifc jdk(mac, window, linux).

3-Cheked your folders and file requered and path jdk/bin/(exec java)

4-see if the execut file java is compatibile your, system in your folder bin

Upvotes: 0

Luis Solano
Luis Solano

Reputation: 41

In my case, IntelliJ was pointing to a JDK folder of a version I had uninstalled. For some reason the uninstaller didnt remove the Java/jdk* folder, so it was not showing any error in the configuration screen File -> Project Structure -> SDK

After finding out it was pointing to an uninstalled JDK folder then I proceeded to adjust this configuration thanks to the answer posted by UberHans

Upvotes: 2

Yao Li
Yao Li

Reputation: 2286

Make sure your JDK path is correct. In my case, it updated JDK version somehow but I didn't notice it, there are a lot of red underlines. After I edit JDK with the correct path, the world became green.

Upvotes: 0

UberHans
UberHans

Reputation: 807

The answer from here Change jdk path in IntelliJ 13 when compiling from 32 bit program file folder to 64 bit one worked for me

From the menu: File -> Project Structure....

On the left, below "Platform Settings", you have "SDKs": click on it; you can add your new JDK here.

Always in the same window, below "Project Settings", select "Project": you have the option to select the JDK which you just added.

Upvotes: 38

Related Questions