for python scripts i was using py2exe to create executable file. Is there any way to create either .exe or .jar file for jython script
Sharing how I achieve this. Thanks to EnigmaCurry for providing the framework.
Jar Method from Jython wiki works quite well. The one drawback that it has is that all of the Java dependancies need to be exploded into the main jar root. This gets messy very quickly.
So the approach uses One-Jar. It is a special class loader which can load a jar from contained in the jar file.
So you can have your script/class, jython and other libraries all getting packaged as a single jar.
You can download the skeleton for achieving this from here.
Once you get it put your scripts in src, put the other jars (including jython jar) in the lib folder, put one-jar source in its respective folder and just run the ant tool with build.xml provided.
You will get your jar then.