#make java import methods from .jar
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
there's nothing more into it i have to create a .jar artifact from my existent project and make it so everything will be imported from the jar instead of my current class
it should work but idk why it's buggy
That's clearly your mistake. You create the jar without adding the library as a dependency.
Or you have to share more details about your current setup
soo u could share what u tried. share some screenshots. share details about ur setup. and so on
right now people can't help u
so ur losing all the momentum from ur post. people click ur thread, see that there is nothing that can be answered currently and then they move along, closing ur thread
i will do it step by step
i'm creating the .jar artifact here
once it's created, i drag it to the "libs" folder that i've created
Then i right click it and add it as a module library
i guess i'm wrong but i should be a library that i can use for my imports by now, but when i try to import this class it doesn't show any library imports from chatlibrary
Are you adding the library to the same library?
honestly i don't even know what i'm doing at this point
i just want the imports to come from the jar file not from the other classes
it says import from the other package, not from the library
so it's not detecting it
What would you expect to be the name of the import?
something that starts with the name of the library
The name of the library doesn't matter. It's the package/folder name that matters.
but it's clearly not retrieving the class from the library as when i remove it from the project it no longer detects anything to import. The library has the class itself, doesn't it?
So if you add the library to the same library the library you exported consists of, the name / import path is the same of the classes
Imports are not needed if you are on the same package level. Therefore I think you are already using the classes from your library
this is what i'm trying to import
this is what is being detected currently
makes sense?
Try to rename the package in your current code and try again to import from the library
That's one reason why it's important to have a namespace for libraries so they don't clash with their paths
cyclic dependence