Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+11 votes

Everytime I try to import "import com.google.gson.Gson;" or " import jakarta.websocket.*;".
my intelliJ either crashes or keeps giving me errors and doesn't let me import the classes needed for networking. Does anyone have any tips on how to properly import these libraries?

P.S. I have already added the needed dependencies into pom.xml

asked in CSC 305 Fall 2024 by (3k points)
edited by

3 Answers

+7 votes

Have you tried maven reload/refresh?

Some other things to try:

  • downloading all the documentation and sources in the maven tab
  • invalidating the caches and restarting IntelliJ.

Q: Does chatterbox work correctly for you?

answered by (5.7k points)
+3

Yes I did maven reload and that worked fine but this is the error that I get when i download the documentation and sources in the maven tab:

"Package 'jakarta.websocket' is declared in module 'tyrus.standalone.client', but module 'edu.augustana' does not read it"

Is there a way for the edu.augustana package to read the module since the our project is using this package as a base for our app

+2 votes

My group had to add a "requires java.net.http;" to our module-info.java for the jakarta.websocket to stop giving us errors!

answered by (1.6k points)
+2 votes

We also had issues with IntelliJ about that. The pom.xml files + module-info files were all be updated but we still had to download documentation and refresh maven + just re-type the import statement and it just worked.

answered by (4.1k points)
...