Jackson Library kann nicht importiert, viele Beiträge und Blogs lesen, aber ich habe immer noch ProblemeJava

Java-Forum
Anonymous
 Jackson Library kann nicht importiert, viele Beiträge und Blogs lesen, aber ich habe immer noch Probleme

Post by Anonymous »

Vor einem Monat begann diese Roadmap von Projekten https://roadmap.sh/backend/projects?difficulty=Begglner mit dem ersten Projekt, einem CLI -Tasktracker. Für ein Projekt, aber ich dachte nicht, dass es ein Problem sein würde. In diesem Projekt muss ich eine JSON -Bibliothek verwenden und fand ein Tutorial, um die Jackson -Bibliothek zu installieren. Im Video heißt es, ich sollte Maven dafür verwenden und das Projekt geändert. Ich habe Git Bash verwendet, um den Code auszuführen (er funktionierte bei ähnlichen heruntergeladenen Testprojekten gut)
Jedes Mal, wenn ich versuche, ihn auszuführen, gibt mir die Konsole diese Nachricht:

Code: Select all

error: package com.fasterxml.jackson.core does not exist

error: package com.fasterxml.jackson.annotations does not exist

error: package com.fasterxml.jackson.databind does not exist
< /code>
Normalerweise habe ich ein paar Beiträge gelesen und auf den Anwer stoße, aber diesmal scheint es, als hätte niemand das gleiche Problem. Es ist zwei Wochen her, seit ich dieses Problem hatte und mehr als fünfzig Beiträge und ein paar nutzlose Installationsanleitungen gelesen habe. < /p>
Das einzige, was ich sicher bin, ist, dass Maven die Bibliothek aus irgendeinem Grund weder aus dem Pom.xml noch dem Klassenpfad importiert. < /p>
Dieses ist mein POM: < /p>

4.0.0


com.fasterxml.jackson.core
jackson-core
2.18.2


com.fasterxml.jackson.core
jackson-annotations
2.18.2


com.fasterxml.jackson.core
jackson-databind
2.18.2


TaskTracker.maven.org
TaskTracker
0.0.1-SNAPSHOT
TaskTracker

< /code>
A nicht wissen, wo man sonst suchen soll, daher ist jede Hilfe willkommen. Eine Version, die ClassPath oder Module verwendet, aber ich denke, das verwendet ClassPath. p> wechseln zu Maven < /p>
< /li>
[*]  Machen Sie das Projekt vom Start (3 mal) < /p>
< /li>
< li>  Ändern des POM -Codes (Änderung zwischen den Versionen usw.) < /p>
< /li>
  Hinzufügen zusätzlicher Abhängigkeiten < /p>
< /li>
  [url=viewtopic.php?t=8986]Importieren[/url] Sie die .jar-Datei in den ClassPath

  Erstellen Sie eine Modul-Info-Datei 
< /li>
  Die Modulin-Info-Datei < /p>
< /li>
< /ul>
Fehler Bei der Versuch MVN sauber Paket 
:

Code: Select all

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< TaskTracker.maven.org:TaskTracker >------------------
[INFO] Building TaskTracker 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ TaskTracker ---
[INFO] Deleting C:\Users\Dante-PC\Documents\JavaProjects\TaskTracker\target
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ TaskTracker ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource from src\main\resources to target\classes
[INFO]
[INFO] --- compiler:3.13.0:compile (default-compile) @ TaskTracker ---
[INFO] Recompiling the module because of changed source code.
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e.  build is platform dependent!
[INFO] Compiling 3 source files with javac [debug target 1.8] to target\classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path is not set in conjunction with -source 8
not setting the bootstrap class path may lead to class files that cannot run on JDK 8
--release 8 is recommended instead of -source 8 -target 1.8 because it sets the bootstrap class path automatically
[WARNING] source value 8 is obsolete and will be removed in a future release
[WARNING] target value 8 is obsolete and will be removed in a future release
[WARNING] To suppress warnings about obsolete options, use -Xlint:-options.
[INFO] 4 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Dante-PC/Documents/JavaProjects/TaskTracker/src/main/java/TaskTracker.java:[95,36] text blocks are not supported in -source 8
(use -source 15 or higher to enable text blocks)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.843 s
[INFO] Finished at: 2025-02-23T10:40:02-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project TaskTracker: Compilation failure
[ERROR] /C:/Users/Dante-PC/Documents/JavaProjects/TaskTracker/src/main/java/TaskTracker.java:[95,36] text blocks are not supported in -source 8
[ERROR]   (use -source 15 or higher to enable text blocks)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post