#Keep getting module not found error in module-info.java

1 messages · Page 1 of 1 (latest)

round jewel
#

Hi there, could someone help me with why I keep getting this error. I've been trying to intergrate JUNG into my project and I've got a error: module not found: jung.algorithms
requires jung.algorithms;

hazy frigateBOT
#

<@&987246399047479336> please have a look, thanks.

round jewel
#

I downloaded the JARS and added them to my project from Project Structure -> Libaries but I keep getting this error and I cant figure out why im getting it

#

This is a gradle project if helpful

round jewel
#

@sharp quiver Sorry to ping, but could this be one of the things you were saying about maven being easier than gradle to work with?

rose torrent
#

it doesnt really have to do anything with maven/gradle

round jewel
#

Ive looked all over stackoverflow and the google and found nothing that has helped this issue

rose torrent
#

I downloaded the JARS and added them
why not adding it through gradle if you use it?

#

no need to download the jars

pliant token
#

@round jewel where are you getting jung.algorithms from?

round jewel
#

If anyone could help me with that I would rly appreciate

pliant token
#

Okay so

#

what editor are you using?

#

what OS are you using?

round jewel
#

All three highlighted have the same error

round jewel
round jewel
pliant token
#

...hmm are you using maven?

round jewel
#

Gradle

pliant token
#

where is it failing?

round jewel
#

So i get error: module not found: jung.algorithms
requires jung.algorithms; for jung.graph.impl;
and jung.api

pliant token
#

can you paste your build.gradle?

#

and does your build file have

#

implementation 'net.sf.jung:jung-algorithms:2.1.1' in it?

#

(or implementation("net.sf.jung:jung-algorithms:2.1.1") if you are doing the kotlin gradle thing)

rose torrent
#

they are manually adding a jar instead of using gradle

#

and I think he runs it with gradle

#

but didnt include the jar

#

or the dependency directly

#

I downloaded the JARS and added them to my project from Project Structure -> Libaries
is not enough if its a gradle project

#

and you wouldnt download a jar manually anyways if using gradle

pliant token
hazy frigateBOT
#

@round jewel

Your question has been closed due to inactivity.

If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.

Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.

When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.

Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.

With enough info, someone knows the answer for sure 👍

round jewel
#

@rose torrent @pliant token hey, so sorry i disappeared, an emergency came up

round jewel
# pliant token can you paste your build.gradle?
plugins {
    id 'java'
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.13'
    id 'org.beryx.jlink' version '2.25.0'
}

group 'com.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

ext {
    junitVersion = '5.8.2'
}

sourceCompatibility = '18'
targetCompatibility = '18'

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

application {
    mainModule = 'com.example.aagtool'
    mainClass = 'com.example.aagtool.HelloApplication'
}

javafx {
    version = '18.0.1'
    modules = ['javafx.controls', 'javafx.fxml']
}

dependencies {

    testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
    implementation 'org.jgrapht:jgrapht-core:1.5.2'
    implementation 'org.jgrapht:jgrapht-ext:1.5.2'







}

test {
    useJUnitPlatform()
}

jlink {
    imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip")
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    launcher {
        name = 'app'
    }
}

jlinkZip {
    group = 'distribution'
}```
hazy frigateBOT
round jewel
round jewel
rose torrent
#

try adding these two:

implementation 'net.sf.jung:jung-graph-impl:2.1.1'
implementation 'net.sf.jung:jung-api:2.1.1'
#

though I doubt that is needed if you have jgrapht

#

it could be that your module-info is wrong

round jewel
round jewel
rose torrent
#

did you reload gradle?

round jewel
#

I did

rose torrent
#

idk why not sharing the module-info?

round jewel
#

Its just when I run the code it breaks and those 20 errors come up

rose torrent
#

yeah ok, wait for someone to help you with this

round jewel
round jewel