问题
I am trying to import dcm4che
library to my java project, because I want to implement a really simple application which will be able to use this library. (https://github.com/dcm4che/dcm4che)
I tried to import this library using Eclipse, IntelliJ and NetBeans. I did some magic with maven (mvn install). And I don't know how to use it. How to begin. Yes, I did use google a lot. I am a beginner in software development so maybe there is a quick and simple solution which I don't know about.
回答1:
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>
回答2:
You dont say what your intended use is -
- Do you want to use the library in another application and just need the jar? If so then mvn install will have already added the dcm4che into your maven repository so you should be able to configure your IDE workspace to use this repository
- Do you want to work on the dcm4che project in your IDE to contribute to the project? The you should just import the maven project from the downloaded directory, or from github
来源:https://stackoverflow.com/questions/37390031/how-to-import-dcm4che-library-to-java-project