• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

generate jar file include only classes

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic