This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

generate jar file include only classes  RSS feed

 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to generate jar file I want to include only .class files and no java files. I am not able to do this.


my root package name is myfolder


myfolder is in parent folder
in dos prompt Iam in parent folder
using the comand

jar -cvf pdfconverter.jar *.class -c myfolder

the generated jar also has java files whihc I dont want what is wrong in my command please advice?

 
Slaxmi Raj
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have to place the .class file in a folder named myfolder.

In command prompt/terminal, go to the parent folder of myfolder.

Syntax:
jar cf jar_file_name dir\{classname(s),*}

Example:

cmd> jar cf myfolder.jar myfolder\*

All the classes from myfolder folder will be now in myfolder.jar file.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!