how can i turn fully coded classes into a library?
❓
52 Replies
⌛
This post has been reserved for your question.
Hey @matheofox! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
The first step would be to create a JAR file
such JAR files can be used as libraries by other Java applications
ok, how do i do that?
i use intelij btw
Are you using a build tool like Maven or Gradle?
gimme a sec i'll check
(how do you check that?)
Is there a pom.xml, build.gradle or build.gradle.kts in your project?
i use grovvy?

Which files are there in your project other than source files?
i'

ok you aren't using a build tool
oh
So IntelliJ is capable of creating JAR files from your code
is that a good or bad thing?
it's fine if you just want to create a JAR file
wait
You can first create an artifact configuration for your JAR and then create the JAR
i have this code right, and i want to be able to use it in diffrent projects without creating the classes, is that what a library do?
yes
you can create a JAR and then use that JAR in other projects
so i'll do the import thing ?
all i have to do for library is to complie it ?
first you need to create a JAR
ok
how do i do that?
is this what i'm supposed to follow?
yes
ok
thx
but i don't want main, i only want the NeuralNetwork class
so?
how do i only keep the NeuralNetwork, Nodes, Weights?
so

You don't need a main class
but i can only pic main?
*pick
A main class is for application JARs
What exactly asks you to pick that class
i don't understand this "good" level in java😭
if i click the little floder logo on the right

you can skip that field
it's only for applications, not for libraries
ok
so do i have to do anything here?

or just press "ok"?
looks fine
not so sure about the "copy the output directory and link via manifest" - because groovy might need it
I guess that option might be better
ah
i alr compiled the thing

should i chage it?
or is this fine?
looks fine
okok now what?
you should be able to take that JAR and import it in the other project
and that's it?
yes
how do i import it?
oh
i don't even need to do that
File > Project Structure I think
i alr did that, but i don't need to import it futher
welp, thanks
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
i'll close the post, thanks for helping me :)))
Post Closed
This post has been closed by <@1043171326082424884>.