java - How to create .jar library from class in Intellij IDEA -


i trying learn java , have implemented single, , simple, class in intellij idea 14.1.3. want able use class in other projects without copy , pasting class source each project src directory. essentially, want create package, or module (i'm not sure which, part of problem) can import projects's src working on--kind of own, one-class, library. while trying figure out how this, came across 2 following blog posts--

http://blog.jetbrains.com/idea/2011/10/new-in-11-create-library-from-project-view/ http://blog.jetbrains.com/idea/2010/08/quickly-create-jar-artifact/

--but when tried instructed (creating artifacts in project structure, etc.) wasn't able because class doesn't have main() method, not meant to. wondering if going right--is there way this, or stuck copying , pasting?

you need main method if want package able run standalone application.

so, answer question: no.

you don't need main method create package, nor import or use package/library in separate application.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -