• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to store jar file in particular place while creating?  RSS feed

 
Rajeev Srikhar
Ranch Hand
Posts: 75
Chrome Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a root folder(First Project ) and it has 3 sub directories (out, res, src). In command prompt I'm at First Project. Now to create a jar file I know I should type But It places jar file in current directory. But I want to store in different directory while creating the jar file itself. How can I do that? I just want to know this out of my curiosity . Also when I create jar file I found a default manifest file. It has only two properties i.e version names of manifest and jdk .Now I want to know how we can add information that we would like to add to the manifest file.
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you tried using a relative path for the JAR name, instead of just first.jar?

As for the manifest file, you can create one yourself, and then add it to the JAR using the -m option. Here's an example:

jar -cfm dist/my-library.jar src/META-INF/MANIFEST.MF -C bin/ package1 package2
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!