DEV Community

Calin Baenen
Calin Baenen

Posted on

Why won't Java import my package?

I have the filesystem:

code:
    Main.java
    org:
        json:
            /* code */
Enter fullscreen mode Exit fullscreen mode

and it showed up in VS code like for a second, and I thought I secured a victory, but, then it just vanished.
When it showed me I could use JSONObject from the library, I was ecstatic, and I tried making a variable with it, but after I made the var, and tried to hover over the class for documentation, nothing came up.
I tried to ctrl+click on it so see if it'd bring me to the file, but it said the file "code/libs/org/json/JSONObject.java" didn't exist(??? why that path??).

I retried, doing import org.json.*;, but I'm not getting any results now, and I don't know what I did the first time to make it work.

Does anyone have advice?

Thanks!
Cheers!

Top comments (1)

Collapse
 
alainvanhout profile image
Alain Van Hout

Have a look at Maven. It's the primary package manager for Java.