Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij error=2 No such file or directory

Tags:

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

like image 227
A.Jac Avatar asked Mar 17 '17 11:03

A.Jac


2 Answers

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.

like image 158
UberHans Avatar answered Sep 18 '22 11:09

UberHans


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

like image 30
Luis Solano Avatar answered Sep 21 '22 11:09

Luis Solano