Home >Java >javaTutorial >Why Does Eclipse Show \'No Compiler is Provided\'?

Why Does Eclipse Show \'No Compiler is Provided\'?

Linda Hamilton
Linda HamiltonOriginal
2024-12-05 00:36:16221browse

Compiler Error: Running on a JRE Instead of JDK

When compiling projects in Eclipse using m2eclipse, users may encounter the error "No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?" This indicates that the project is attempting to compile with a Java Runtime Environment (JRE), which lacks the compilation capabilities of a Java Development Kit (JDK).

To resolve this issue, follow these steps:

  1. Navigate to Eclipse's Window > Preferences.
  2. Select Java > Installed JREs.
  3. Ensure that a JDK is installed and select it as shown below:

Why Does Eclipse Show

  1. Click OK.
  2. Right-click on the project and select Maven > Update Project.

Additionally, verify the Maven JRE settings by following these steps:

  1. Access the Run Configurations window through the Run menu.
  2. Select the Maven Build configuration.
  3. Navigate to the JRE tab and ensure that Workspace default JRE is selected.

By performing these steps, Eclipse will recognize the installed JDK and allow you to compile projects successfully.

The above is the detailed content of Why Does Eclipse Show 'No Compiler is Provided'?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn