Tutorials  /  JavaScript

Eclipse Troubleshooting: Adjusting Java Project Facet Version

Ccentron Redaktion · May 2024 ·2 min read ·JavaScript, Tutorial

Contents

  1. Problem Statement
  2. Solution Approach
  3. Additional Tip: Changing the Compiler Compliance…
  4. Conclusion

Problem Statement

After importing a Maven project into Eclipse and changing the build path to Java 1.7, an error message appeared in the project, although no file showed an error. The error description read: "Java compiler level does not match the version of the installed Java project facet". Despite changing the compiler compliance level to 1.7, the error persisted.

VM

Matching infrastructure at centron

Node applications need somewhere to run: ccloud³ VMs with full root access from €4.04 per month – or as a managed server if you would rather not run it yourself. Rent a cloud server →

Solution Approach

The solution to the problem was simpler than expected. I just had to change the Java project facet version from 1.5 to 1.7. This can be done either through the project properties in the Eclipse UI or by directly editing the project settings.

Changing via Eclipse UI:

  1. Open the project properties.
  2. Change the version of the Java project facet to 1.7.

Changing via the configuration file:

  1. Open the file org.eclipse.wst.common.project.facet.core.xml in the .settings folder of the project.
  2. Change the entry for the Java facet from 1.5 to 1.7.

Additional Tip: Changing the Compiler Compliance Level via Terminal

If you, like me, prefer to make settings via the terminal, you can change the compiler compliance level by editing the file org.eclipse.jdt.core.prefs:

  • org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
  • org.eclipse.jdt.core.compiler.compliance=1.7
  • org.eclipse.jdt.core.compiler.source=1.7

Conclusion

Through these simple steps, I was able to quickly and efficiently solve the problem with the Java compiler level in Eclipse. This method is particularly useful if you prefer to make settings not through the user interface, but directly through configuration files or the terminal. I hope this post can help other developers who encounter similar problems.

Claim €200 credit

Test your setup on ccloud³

Sign up for ccloud³ and receive €200 starting credit for your project.

centron Redaktion Technical editorial team

The centron editorial team writes guides from day-to-day operations: tested on our own platform, run in our data centre in Hallstadt near Bamberg.

Category JavaScript
Share
Still have questions?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

Was this tutorial helpful?

Your answer is stored anonymously and helps us improve our tutorials.

Comments

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Get started for free

Sign up and receive €200 credit at centron within your first 60 days.

This promotional offer applies to new accounts only. Available exclusively to businesses.