I get an error downloading javax.media.jai_core:1.1.3 from maven central
Asked Answered
L

5

27

I get an error downloading javax.media.jai_core:1.1.3 from maven central.

The error is:

download failed: javax.media#jai_core;1.1.3!jai_core.jar

using play compiler.

Lavern answered 18/11, 2014 at 11:23 Comment(0)
L
33

The problem at this moment is that maven-central doesn't have the .jar, which is a dependency from geotoolkit

Sample of maven repo content

If you need it, you could use the next public repositories:

https://maven.geotoolkit.org (jai-core is here)

https://repo.osgeo.org/repository/release/

Make sure geotoolkit-repo is before Maven Central, so that it resolves before Central which misses the jar.

Lavern answered 18/11, 2014 at 11:28 Comment(2)
I have tried both, but it is not working, it's trying to download a wrong url maven.geotoolkit.org/javax/media/jai/…Lucent
"Make sure geotoolkit-repo is before Maven Central, so that it resolves before Central which misses the jar." Why??? When a jar isn't found in one repo, couldn't it simply look in the next one? What if geotoolkit-repo misses a jar which is in Maven Central?Demonstration
D
9

For Gradle users:

    mavenCentral().content {
        excludeModule("javax.media", "jai_core")
    }
Dekker answered 28/7, 2021 at 16:31 Comment(1)
Note the underscore ;-)Severen
F
6

And move the http://download.osgeo.org/webdav/geotools repo to the first position in your repo list. Otherwise it will probably still give you that error.

Furie answered 13/4, 2018 at 23:48 Comment(2)
Why is this necessary?Selfgovernment
It's necessary to have Geotools-repo first as Maven Central includes the dependency, but not the .jar. Therefore it is "resolved" in Central, but actually not found. Central, pom but no jar: repo1.maven.org/maven2/javax/media/jai_core/1.1.3 Geotools, pom and jar: repo.osgeo.org/#browse/…Evincive
S
3

I was having a similar problem, trying to add icepdf to my pom for a project. What worked for me was adding this exclusion inside de dependency tag:

<exclusions>
    <exclusion>
        <groupId>javax.media</groupId>
        <artifactId>jai-core</artifactId>
    </exclusion>
</exclusions>

Here is the link to the answer that helped me, hoping it helps some other people having this same issue:

https://mcmap.net/q/505894/-basic-code-to-display-a-pdf-in-an-existing-jpanel

Suction answered 3/4, 2020 at 15:25 Comment(1)
If your project doesn't need jai-core it can work. What you should take into account that excluding a dependency from your project could result in some runtime errors depending of the functionality you are using.Lavern
W
1

Solution for gradle with kotlin dsl (8.4)

Below changes in file build.gradle.kts

Add jboss repository in repository section

 maven {
    url = uri("https://repository.jboss.org")
 }

Exclude from dependencies using jai_core

implementation("org.geotools:gt-shapefile:30.0") {
    exclude("javax.media", "jai_core")
}
implementation("org.geotools:gt-swing:30.0") {
    exclude("javax.media", "jai_core")
}

Add dependency on jai.core that exists in jboss maven repository

implementation("javax.media:jai-core:1.1.3")
Wideman answered 28/11, 2023 at 17:0 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.