-2

I'm trying to write a Java program in Intellij on Ubuntu 18.04. There is nothing wrong with the code, I can run it on my Windows machine at home.

When I'm trying to build the program i get the following error message:

Error:Cannot run program "/usr/bin/jdk1.8.0_202/bin/java" (in
directory "/home/oskar/.IdeaIC2019.1/system/compile-server"): error=2,
No such file or directory
Smajl
  • 7,169
  • 25
  • 104
  • 171
cephlot
  • 124
  • 1
  • 12

1 Answers1

3

First of check that /usr/bin/jdk1.8.0_202/bin/java is present - as in check that you have the Java SDK.

If you have it, Then you need to specify the SDK for your projectin iteliJ. To do this goto Project setting and select your SDK with the drop down, as shown below

Goto File -> Settings -> Project and you will see the bellow menu.

InteliJ Project Structure

If you don't have the Java SDK there, go ahead and install the Java JDK download from https://www.oracle.com/technetwork/java/javase/downloads/index.html After installing the SDK, navigated to the Project Settings again and select the new JDK configuration from the installation location.

Then you can build the project and it should work all fine!

UrbanConor
  • 153
  • 1
  • 4
  • 15