问题
I am using eclipse Kepler (enterprise edition), Java 8, and M2Eclipse and trying to make a web application. I have already gone to help -> eclipse marketplace and installed these two patches:
- Java 8 support for Eclipse Kepler SR2
- Java 8 support for m2e for Eclipse Kepler SR2
Those patches cleared up a lot of my problems, but one remains. I did a maven -> update from within eclipse, it went and updated all my projects except the only web app in my workspace. It gives me a pop up message that says "Version 1.8 of project facet java does not exist"
I opened my project properties and clicked Project Facets. Sure enough, the java facet maximum version is 1.7. So I am wondering why I don't have the same problem on my other projects. I viewed the properties on my other projects and discovered that none of them are using Project Facets at all. I think this might be because I made all of the previous projects using a standard edition of eclipse, not an enterprise edition.
So I guess I have a couple questions. How can I get eclipse to recognize the java facet 1.8? Is there a way I can have my web app not use Project Facets? Should I add Project Facets to my other projects?
回答1:
Just ran into this issue. My problem was with the tomcat server looking in the wrong place for the JRE. To fix that:
- Double click on the server in the servers tab
- Open "Runtime Environment"
- Change the JRE selector.
Hope this saves someones time
回答2:
I am using 4.3.2 version of Eclipse Kepler SR2 and ran into the same issue when the java version was bumped up from 1.7 to 1.8 for our maven project.
I was getting the following error while trying to do Maven Update : An internal error occurred during: "Updating Maven Project". Version 1.8 of project facet java does not exist.
If you check the Java Project Facet Version (Right click on project -> Properties -> Search for Project Facets -> Java (Version)) .. it must be an older version.
Project Facet Screenshot
Solution :
Goto Eclipse Marketplace and install the following :
- Java 8 support for Eclipse Kepler SR2
- Java 8 Facet for Web Tools for Eclipse Kepler SR2
Now, change the Java Project Facet Version to 1.8
Right click on project -> Properties -> Search for Project Facets -> Java (Version)
Now, you should be able to successfully take a maven update.
回答3:
To fix this in eclipse, go to "Help" --> "Market Place" --> Search java 8 kepler. Then install all the 3 below plugins
install Java 8 support eclipse kepler sr2, install Java 8 Facets for web tools eclipse kepler sr2 install Java 8 support for m2e for Eclipse Kepler SR2 (if you are using maven)
Reference: http://www.eclipse.org/downloads/java8/
or You can try this
Select Project properties -->Project facets than at there change your java to the version of your workspace.
回答4:
right click on your project > properties > java > compiler > compliance level > set it to 1.8
回答5:
I too faced the same problem. I did like the below.
Right click on your project -> Build Path -> Configure Build Path.
On that, select Java Build Path, if there is any wrong mark indicated in the JRE System Library, select Library Tab and add JRE Library.
Once JRE Library added successfully, select the JRE System Library in Order and Export Tab and then click ok.
Then restart your eclipse.
Hope it may help you.
回答6:
I had the same issue when our project upgraded from jdk 1.7 to 1.8 and server Tomcat to JBOSS. When I checked the Targeted Runtimes (Project-->right click-->properties-->Targeted Runtimes), it was pointing to Tomcat, and as I changed it to JBOSS the Project facets gave me java 1.8 version.
来源:https://stackoverflow.com/questions/24298501/eclipse-has-no-java-facet-version-1-8