Jump to content

Create Jar And Include External Jars

Recommended Posts

I have an Eclipse project MyApplication, that I want to export into a runnable jar file MyApplication.jar. I know it is easy with an Ant task, but I want to simulate it via batchscript command line.Basically, I want the ability that the Eclipse Ant task has, to include external jar files, and NOT by adding it to the classpath in the jar's manifest file. The ant task ultimately adds the content of an external jar file into the new jar. Can this all be done with batchscript?Whereas the script for creating a jar would be:

set COMMANDJAR="C:\Program Files\Java\jdk1.6.0_13\bin\jar.exe"set JARFILE=MyApplication.jarset MANIFEST=manifest.txtset SOURCEDIR=bin%COMMANDJAR% cfm "%JARFILE%" "%MANIFEST%" -C "%SOURCEDIR%" .

So how to include the contents of "external.jar" to MyApplication.jar?Or better said, what is the command line replacement for <zipfileset> in an Ant task?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...