Opening other people's projects in IDEA can't run, right click and there is no run option to solve the problem

Opening other people's projects in IDEA can't run, right click and there is no run option to solve the problem

1. Problem description:

The following problems occurred when opening someone else's project:

  • Question 1: Without the run option, there is no way to run it.
  • Question 2: There are many red line errors.

insert image description here

2. Reason

SDK is jdk, no choice

3. Solutions

  1. Click File → Project Structure, as shown in the figure below.
    insert image description here

  2. The cause of the problem was found, JDK was not configured
    insert image description here

  3. Pull down to select the appropriate JDK, mine is JDK1.8, yours may also be JDK1.11.

    Then click Apply first, then click OK.

    problem solved.
    Note: If it doesn't work, restart the project to see.

Note: 99% of users will solve the problem after performing the above steps, but if it is still not solved, then follow the steps below.

1. The SDK is specified, but it still does not run

  1. Open the Maven Projects window (on the right side of the idea window, if not, just open the window below)
  2. Click "+", select the pom file that needs to start the project, and click ok
  3. The project and all subprojects under the project will appear in the right column
  4. Click to expand the project that needs to be started -> Lifecyle
  5. double click install

2. Make sure the program has a main method and specify the SDK, then manually configure the launcher

Little Triangle SelectionEdit
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/m0_50736744/article/details/121353171