user6289326
user6289326

Reputation:

How to create .jar library

I wrote some java classes hat contain more new functions, now I want to create a java library.

All my classes are writen to add functions in an Android application, so my question is:

How i can create a java library using my java classes ?

Exist a particular procedure for Android application or i can use standard way (command line) ?

Is it a good way use this command ?

java -jar cf myJar.jar myClass.class

What is the best way to create my jar ?

Upvotes: 0

Views: 324

Answers (1)

radai
radai

Reputation: 24202

you can use the JDK's built-in jar utility to create your jar file:

jar cf jar-file input-file(s)

however, beyond really small and simple toy projects, no one does that. what you really want to do is learn about modern build systems, how they work, and how to use them.

the 2 most popular ones these days are maven and gradle, and if youre after android development gradle is probably the better choice. its a learning curve, but its the only way to go forward.

Upvotes: 1

Related Questions