Json Simple dependency Issue

458 Views Asked by At

So I have been trying to import JSON Simple (https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple/1.1.1) I am also using Visual Studio Code. So I have added the dependency in my pom.xml file, but it still wont find my imports. Do I have to add soemthing to my module-info? (fixed a different issue for me) I tried requires com.json.simple; or requires com.googlecode.json.simple; but I get the cannot be resolved to a module error. Also my project is a javafx Application, that implements server socket networks (JSON exchage). Im at a complete los here on what to do... Thanks for your help.

1

There are 1 best solutions below

0
lenieve On

So after a lot of trial and error, i have finally fixed it. Instead of vs code I used IntelliJ and added the dependencies there. Its impotant to note, that after every import I had to restart intelliJ also make sure to press the icon as mentioned in this tutorial https://www.jetbrains.com/help/idea/work-with-maven-dependencies.html#maven_import_dependency.