Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Build Path

When I open eclipse I got 1 Java Build Path Problem: Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment.

Now I tried looking through the answers and other question, but all the answers are based on the already acquired knowledge about programming and such. Please help me fix this problem step by step.

like image 276
Kevin Avatar asked Jun 17 '12 12:06

Kevin


People also ask

How do I find the build path of a Java project?

Code in the source folders. Jars and classes folder associated with the project. Classes and libraries exported by projects referenced by this project. The java build path can be seen and modified by using the Java Build Path page of the Java Project properties dialog.

What is build path in Eclipse?

Eclipse - Java Build Path - The Java build path is used while compiling a Java project to discover dependent classes . It is made up of the following items −

How do I add a jar to the Java build path?

To bring up the Java Project properties dialog box, right click on a Java Project in the Package Explorer view and select the Properties menu item. On the left hand side tree select Java Build Path. A common requirement seen while developing java applications is to add existing jars to the java build path.

How to set java path in Windows 10?

Go to Environment Variables: Press “New” button in “System variables” section: Type name “JAVA_HOME” and value – your path to Java, in my case, it’s C:\Program Files\Java\jre-9.0.4 and press “OK“. Done. How to set Java path. Find “Path” system variable and press “Edit“.


Video Answer


1 Answers

Your problem is that the Eclipse project is already configured to work on version 6 of the system libraries. You however do not seem to have this specific version, therefore you need to reconfigure the build path for the project.

In order to change your JRE System Library, you must

  1. Go to Project|Properties
  2. Choose the Java Build Path section
  3. Select the current JRE System Library, and choose Remove
  4. Select Add Library, and under the JRE System Library category pick your system library; you probably just need to choose the Workspace default JRE

If the default JRE version is <= 4, you most likely will have problems building the project. In that case I suggest you install a more recent JRE.

More generally, under Window|Preferences, you can check Java|Installed JREs|Execution Environments to know which of the installed JREs match a specific execution environment. Should be pretty clear, but that page demystifies things a bit.

like image 162
Luca Geretti Avatar answered Sep 28 '22 05:09

Luca Geretti