#Java help with imports
1 messages · Page 1 of 1 (latest)
<@&987246652869971988> please have a look, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
Your issue is likely related to the build setup not recognizing the SLF4J library even though your IDE shows no import errors. This usually happens when the SLF4J jar is added to your project folder manually but not included in your build path or classpath used during compilation.
Key points to check:
- Make sure your build tool (e.g.,
javaccommand, Maven, Gradle) is configured to include the SLF4J jar in the classpath. - If building manually, use something like
javac -cp "path/to/slf4j-api.jar;." YourClass.java. - If using an IDE build, ensure the library is added as a dependency or external library and linked properly.
- In a multi-module or multi-folder project, check no mismatch exists between source folder settings and library location.
- Sometimes the editor shows no errors because it reads project settings, but the command-line or build tool ignores them.
Without proper classpath configuration for compilation, the package does not exist error will show even though your imports appear valid inside the IDE.
Useful links:
Hello, so I was coding a minecraft launcher and I impoprted gson library but it shows i didnt
wait i send you a screenshot of it
here that I have the .jar file of slf4j api
and some other ones i use (i get errors too on them)
i also imported them in libraries and modules
Pong — ready. How can I help with your code review?
I got the same reponse from chatgpt, and yes I imported them
and still the same
i also asked grok and deepseek none of them helped
now I can only hope for help from a real person
If someone could help me, I'd be grateful
Lol, lmao even
Yeah the earlier you learn to never use those the better
I'm looking at your screenshots now
Ahhhhhh I see
So you have two things going on
intelliJ and it's configuration
And Gradle and it's configuration
You added slf4j to intelliJ and so it gives you no red lines
But Gradle doesn't have a dependency declaration for it
So in your build.gradle look for any "implementation" lines
Share what you find
wait
yeah so in my build.gradle i just got this:
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.14'
}
group = 'com.originlauncher'
version = '1.0.0'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
javafx {
version = "17.0.10"
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.media' ]
}
application {
mainClass = 'com.OriginLauncher.Main'
}
Ah I see
Javafx is strange in all these
Add a new "dependencies {}" section
From context clues I think you are modifying an existing project
I mean kinda deepseek helped me
Trust me, stop
You've never seen brain damage until you've seen someone who uses AI heavily when learning
And we see it here a lot
yeah because I dont have anyone to ask
only you
here
yes thanks
okay, so thanks for your response, if I got now any prblems I try to ask here
on this server
That or - and I know this sounds wrong - struggle and do trial / error
Skill acquisition has basically two steps
The first is getting info, the second is reinforcement
With AI you skip step 2 and so don't actually learn
wait wait I need to translate this because this it too much for my english 💔
Conversely, time you spend struggling builds "debug stamina"
And other skills you need to be competent
yeah now i understand
so I should stop using ai from what i translated
and understoof
understood
and what about youtube?