How to import dcm4che library to java project?
Asked Answered
D

2

12

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.

Demijohn answered 23/5, 2016 at 11:41 Comment(0)
H
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>
Horne answered 4/8, 2016 at 19:24 Comment(0)
E
-1

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
Elan answered 10/8, 2016 at 8:29 Comment(1)
Actually the question was quite clear: "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." She likes to import it through the maven, to use it as a maven dependency.Horne

© 2022 - 2024 — McMap. All rights reserved.