-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
2

1 Answer 1

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 project in Intellij. To do this goto "Project Settings" and select your SDK with the drop-down, as shown below

Goto "File" → "Settings" → "Project" and you will see the below 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, navigate to "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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.