12

我正在尝试将dcm4che库导入我的 java 项目,因为我想实现一个非常简单的应用程序,它将能够使用这个库。(https://github.com/dcm4che/dcm4che

我尝试使用 Eclipse、IntelliJ 和 NetBeans 导入这个库。我用 maven (mvn install) 做了一些魔术。而且我不知道如何使用它。如何开始。是的,我确实经常使用谷歌。我是软件开发的初学者,所以也许有一个我不知道的快速简单的解决方案。

4

2 回答 2

12

Using Apache Maven is of course the best and easiest option. You will need to add the dcm4che repository as well as the dcm4che dependencies into your pom (see details below).

Once you have the pom ready, make sure everything compiles by a 'mvn clean install'. Import the required classes appropriately inside your application's classes.

Add repository to the pom:

<repositories>
<repository>
    <id>www.dcm4che.org</id>
    <name>dcm4che Repository</name>
    <url>http://www.dcm4che.org/maven2</url>
</repository>
</repositories>

Add dependency to the pom:

<dependency> 
    <groupId>dcm4che</groupId>
    <artifactId>dcm4che-core</artifactId>
    <version>2.0.29</version>
</dependency>
于 2016-08-04T19:24:06.513 回答
-1

你没有说你的预期用途是什么 -

  • 您想在另一个应用程序中使用该库并且只需要 jar 吗?如果是这样,那么 mvn install 将已经将 dcm4che 添加到您的 maven 存储库中,因此您应该能够配置您的 IDE 工作区以使用此存储库
  • 您想在您的 IDE 中处理 dcm4che 项目来为该项目做出贡献吗?您应该只从下载的目录或从 github 导入 maven 项目
于 2016-08-10T08:29:56.967 回答