1

I have been trying to convert jython scripts to .jar file. I followed,

Distributing my Python scripts as JAR files with Jython?

The link above and also the Jython wiki link shown inside it use a command line script called, "zip". Its like => zip myapp.jar Lib

and so. I am on windows machine, so I couldn't find any script as "zip" on my command line, may be its a Linux script. Help me to do it in windows machine

Second is I have few external .jar's that are used in my jython scripts, for this the above link says to use manifest. But I want to package all external jars into single myapp.jar(for example) file to be running. Just like java -jar myapp.jar, so is there any way to package external jars also?

So please help me resolve this

2 Answers 2

1

You can use jar command to add files to .jar archive. Just like:

jar uvf jythonlib.jar Lib

Use jar to see help with options and examples of usage.

Sign up to request clarification or add additional context in comments.

Comments

0

As you can see, the code zip -r jythonlib.jar Lib and zip myapp.jar Lib/showobjs.py, just add files to a jar archive. The zip program is a specific tool to do this, but it is not the only one. On windows, I would recommend using 7-zip to create the jar. Rather than zip -r jythonlib.jar Lib, open a new 7-zip window, create a new archive (zip protocol) called jythonlib.jar and add the folder called Lib which resides in $JYHTON_HOME. Then continue with the guide and when you get to zip myapp.jar Lib/showobjs.py, simply drag and drop the file called showobjs.py into the existing 7-zip window. This should add the file to the archive.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.