代码之家  ›  专栏  ›  技术社区  ›  Mayur

我试图导入(import org.springframework.context.ApplicationContext),但它给了我错误org。Sprigframew无法解决

  •  0
  • Mayur  · 技术社区  · 2 年前

    我尝试使用applicationContext接口的getbeans方法,因为我尝试导入springframework软件包。我看过navin reddy的视频,在视频中,他使用了具有以下依赖项的maven,他能够导入这些软件包,但是。下面是我正在使用的依赖项:

    <dependencies>
    <dependency> 
    <groupId>junit</groupId> 
    <artifactId>junit</artifactId> 
    <version>3.8.1</version> <scope>test</scope> 
    </dependency>
    
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>4.2.4 RELEASE</version>
    </dependency>
    </dependencies>
    

    我希望导入问题能够得到解决,这样我就可以使用applicationcontext对象了

    1 回复  |  直到 2 年前
        1
  •  1
  •   Gurkan Ä°lleez    2 年前

    正确的一点:

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.2.4.RELEASE</version>
        </dependency>
    

    错的一个:

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>4.2.4 RELEASE</version>
    </dependency>
    

    我猜spring没有4.2.4版本。只需添加(.)到4.2.4。释放