creating java library jars with intellij

15,720

You can use artifacts to achieve this: http://blogs.jetbrains.com/idea/2010/08/quickly-create-jar-artifact/ and http://www.jetbrains.com/idea/webhelp/packaging-a-module-into-a-jar-file.html. This is the way you do it in intellij.

Share:
15,720
Admin
Author by

Admin

Updated on June 16, 2022

Comments

  • Admin
    Admin almost 2 years

    I am trying to create a library jar out of the compiled java files or a piece of code organized into directories. When I create the jar file using eclipse and use it in the actual code it is working fine but when i use intellij to create the jar file, the code is not able to find the packages which are in the jar file. when i compare the two jar files(the one created by eclipse and the one created by intellij), they have the same directory structure and both have manifest files with dummy information. What could i be doing wrong here. I think i am missing something obvious.

    Thanks

    edit: The question is answered, I need to put the 'compiled output' into the jar ; i was manually adding the compiled class files to jar and for some reason it did not work.