0

Eclipseヘリオスでjsf2hibernate4.1.4、spring 3.1、maven3を使用しています。しかし、依存関係をPOMに追加しようとすると、このエラーが発生します。

Java compiler level does not match the version of the installed Java project facet.

どういう意味ですか?このエラーを解決するにはどうすればよいですか?

また、私はこの警告があります:

Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.   

私のPOM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.integrate</groupId>
  <artifactId>integrate</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>integrate</name>
  <dependencyManagement>
    <dependencies>
    </dependencies>
  </dependencyManagement>
  <properties>
  <spring.version>3.1.0.RELEASE</spring.version>
 </properties>

 <dependencies>

  <!-- Spring 3 dependencies -->
  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-core</artifactId>
   <version>${spring.version}</version>
  </dependency>

  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-context</artifactId>
   <version>${spring.version}</version>
  </dependency> 

  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-web</artifactId>
   <version>${spring.version}</version>
  </dependency>

  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-tx</artifactId>
   <version>${spring.version}</version>
  </dependency>

  <dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-orm</artifactId>
   <version>${spring.version}</version>
  </dependency>

  <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>

  <!-- JSF dependencies -->
  <dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-api</artifactId>
    <version>2.1.6</version>
  </dependency>

  <dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-impl</artifactId>
    <version>2.1.6</version>
  </dependency>

  <dependency>
   <groupId>javax.servlet</groupId>
   <artifactId>jstl</artifactId>
   <version>1.2</version>
  </dependency>


  <!-- Hibernate dependencies -->
  <dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-core</artifactId>
   <version>4.1.4.Final</version>
  </dependency>

  <dependency>
   <groupId>javassist</groupId>
   <artifactId>javassist</artifactId>
   <version>3.12.1.GA</version>
  </dependency>

  <!-- oracle Connector dependency -->
  <dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
</dependency>
<!-- c3p0 dependency -->
      <dependency>
       <groupId>c3p0</groupId>
       <artifactId>c3p0</artifactId>
       <version>0.9.1.2</version>
  </dependency>  


 </dependencies>

その写真: ここに画像の説明を入力してください

4

3 に答える 3

1

maven-compiler-pluginを含むbuildセクションをpom.xml に追加するだけです。

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
    </plugins>
</build>

次に、プロジェクトのビルド パスを構成する必要があります。

または、Eclipse ワークスペースからプロジェクトを削除し (ファイル システムから削除せずに)、プロジェクトから Eclipse の設定 (.project、.classpath、および .settings ファイルとフォルダー) を削除し、プロジェクトを既存の Maven プロジェクトとしてIDE。Eclipse は設定を適切に再生成します。

于 2012-07-02T10:30:34.253 に答える
0

プロジェクトに関連するプロジェクト ファセットを確認してください (プロジェクト/プロパティ/プロジェクト ファセット/Java を右クリック)。

システムにインストールした Java のバージョンと、プロジェクトのプロジェクト ファセットで指定している Java のバージョンが一致していない可能性があります。

于 2012-07-02T10:29:28.833 に答える
0

D:\maven-2.2.1\conf toolchains.xml で Maven の Java バージョンを指定します。

<?xml version="1.0" encoding="UTF-8"?>
<toolchains>
<toolchain>
    <type>jdk</type>
    <provides>
        <version>1.5</version> <!--This should be same as is configured via the toolchains plugin -->
        <vendor>ibm</vendor> <!--This should be same as is configured via the toolchains plugin -->
    </provides>
    <configuration>
        <jdkHome>C:\Program Files\Java\jdk1.5.0</jdkHome>
    </configuration>
</toolchain>
</toolchains>
于 2012-07-02T11:48:15.980 に答える