Search code examples
javaandroidintellij-ideajar

How can i create jar file?


I have a mobile application project. I convert it as a jar file with Intellij Idea. But there is nothing in the jar file. How exactly can I create the jar file? I researched on the internet and found out in the sources that it can also be done via terminal, but I am getting errors with that method as well. Can you help me?

My other question is this: Am I considered to have hidden the source code when I convert it to a jar file? So when I give this file to someone else, I don't want them to receive the source code.


Solution

  • I converted the project from Application type to Library type in the gradle file and exported it in aar format. I was able to export it by hiding the source code. My problem is solved. Thanks to Robert for presenting this idea.