IT박스

"직면 한 프로젝트 문제 (Java 버전 불일치)"오류 메시지

itboxs 2020. 10. 31. 09:30

"직면 한 프로젝트 문제 (Java 버전 불일치)"오류 메시지


Eclipse의 "문제"탭에 다음 오류가 표시됩니다.

설명 : Java 컴파일러 레벨이 설치된 Java 프로젝트 패싯의 버전과 일치하지 않습니다.
리소스 : 그룹화
경로 : [공백]
위치 : 알 수없는
유형 : 패싯 프로젝트 문제 (Java 버전 불일치)

pom.xml설정은 다음과 같습니다.

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
        </configuration>
    </plugin>
</plugins>

설정이 일치하지 않을 수있는 다른 곳은 어디입니까?


Project Properties -> Project Facets패널 을 확인 했습니까 ? ( 그 게시물에서 )

WTP 프로젝트는 여러 기능 단위 (패싯이라고 함)로 구성됩니다.

Java 패싯 버전은 항상 Java 컴파일러 준수 레벨과 일치해야합니다.
Java 레벨을 변경하는 가장 좋은 방법은 두 장소를 동시에 업데이트하므로 프로젝트 패싯 속성 패널을 사용하는 것입니다.

WTP

" Project->Preferences->Project Facets"는 org.eclipse.wst.common.project.facet.core.xml" .settings"디렉토리 아래의 " " 파일에 구성을 저장합니다 .

내용은 다음과 같습니다.

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <runtime name="WebSphere Application Server v6.1"/>
  <fixed facet="jst.java"/>
  <fixed facet="jst.web"/>
  <installed facet="jst.java" version="5.0"/>
  <installed facet="jst.web" version="2.4"/>
  <installed facet="jsf.ibm" version="7.0"/>
  <installed facet="jsf.base" version="7.0"/>
  <installed facet="web.jstl" version="1.1"/>
</faceted-project>

Java 준수 수준 도 확인하십시오 .

자바 준수 수준


문제를 해결하기위한 두 가지 옵션이 있습니다.

1- Manually make sure the two versions match.
2- Use the IDE's help as follows:
- Right mouse click on the error in the 'Problems' view
- Select the 'Quick Fix' menu item from the pop-up menu
- Select the right compiler level in the provided dialog and click 'Finish'.

Taken from Eclipse: Java compiler level and project facet mismatch

Also gives location of where you can access the Java compiler and facet version.


The project facets should be derived automagically by the M2Eclipse plugin from the POM configuration. If you make some changes to the POM and need Eclipse to take them into account, right-click on your project, then go to Maven > Update Project Configuration. You should not set project facets manually.


In Spring STS, Right click the project & select "Open Project", This provision do the necessary action on the background & bring the project back to work space.

Thanks & Regards Vengat Maran


I encountered this issue while running an app on Java 1.6 while I have all three versions of Java 6,7,8 for different apps.I accessed the Navigator View and manually removed the unwanted facet from the facet.core.xml .Clean build and wallah!

<?xml version="1.0" encoding="UTF-8"?>

<fixed facet="jst.java"/>

<fixed facet="jst.web"/>

<installed facet="jst.web" version="2.4"/>

<installed facet="jst.java" version="6.0"/>

<installed facet="jst.utility" version="1.0"/>

참고 URL : https://stackoverflow.com/questions/2239959/faceted-project-problem-java-version-mismatch-error-message